Oracle table update exist ?
220 pts.
0
Q:
Oracle table update exist ?
dear all, i want implemente a update on many table but i don't know the syntax please help me. My update is at less on 5 table
ASKED: Nov 3 2009  12:36 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
220 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Last Answered: Nov 3 2009  12:36 AM GMT by Tchywallace   220 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Carlosdl   29855 pts.  |   Nov 3 2009  5:37PM GMT

You can’t update more than one table with a single update statement.
Why do you need to do this ?

 

Tchywallace   220 pts.  |   Nov 3 2009  6:23PM GMT

I must do a form who insert, update, delete on five table. I make a first objective who insert in five tables in using insert all and the end add select * from dual
with out problem.
I want update more than table because there are a link between this data. if there are no solution for updating at more table so how implemente a update on my five tables

 

Carlosdl   29855 pts.  |   Nov 3 2009  7:07PM GMT

You can update your five tables with a stored procedure, or in your application.

Without more details about your table structures, the links between them, and how you want to update them, it would be really difficult to provide more help. Please provide more details.

 

Tchywallace   220 pts.  |   Nov 4 2009  10:51AM GMT

i want to show the picture of my database i don’t how i can insert in this

 

Tchywallace   220 pts.  |   Nov 4 2009  11:24AM GMT

I have found a maner to insert a picture so this database. as you can see i want implemente a update in this table in one clic
gestock

 

Tchywallace   220 pts.  |   Nov 4 2009  11:26AM GMT

 

Tchywallace   220 pts.  |   Nov 4 2009  11:28AM GMT

gestock

 

Tchywallace   220 pts.  |   Nov 4 2009  11:34AM GMT

Gestock

 

Tchywallace   220 pts.  |   Nov 4 2009  11:38AM GMT

Ok this the picture at the end so as you can see my 5 table are
Tbl_disk, appartenir, tbl_pack, compatible, tbl_ss_plateforme. yes i want make in one clic a update and delete with form help.
PLease for this patience

 

Carlosdl   29855 pts.  |   Nov 4 2009  2:28PM GMT

We can see the tables, but we don’t know how you want to update them.

In general, you can write one update statement for each table in your click event handler (how to do that will be different depending on the programming language, which you did not specify), or you could write an Oracle stored procedure with the 5 updates and call it from the click handler of your program.

Something like this:

CREATE OR REPLACE PROCEDURE your_procedure (p_new_value in number) IS
BEGIN
	UPDATE table_x SET x_column = p_new_value
	WHERE…

	UPDATE table_y SET y_column = p_new_value
	WHERE…

	UPDATE …
	…
END;

 

Tchywallace   220 pts.  |   Nov 5 2009  12:04PM GMT

Ok as MySQL Server there are a simple maner to update many table this the syntax :

update TableOne, TableTwo
set TableOne.field1 = word1, TableTwo.field1 = word2

where <a href="http://TableOne.com" title="http://TableOne. " target="_blank">TableOne.com</a>monID = <a href="http://TableTwo.com" title="http://TableTwo. " target="_blank">TableTwo.com</a>monID

With the case on MySQL server there are no problem also oracle …. @@@ERROR@@@
If you thinks your sintax is good i want try

 

Tchywallace   220 pts.  |   Nov 5 2009  12:14PM GMT

I don’t there are always a problem when i want post a msg
update TableOne, TableTwo
set TableOne.field1 = TableTwo.fieldX
where <a href="http://TableOne.com" title="http://TableOne. " target="_blank">TableOne.com</a>monID = <a href="http://TableTwo.com" title="http://TableTwo. " target="_blank">TableTwo.com</a>monID

 

Tchywallace   220 pts.  |   Nov 5 2009  12:18PM GMT

update TableOne, TableTwo
set TableOne.field1 = word1, TableTwo.field =world2
where <a href="http://TableOne.com" title="http://TableOne. " target="_blank">TableOne.com</a>monID = <a href="http://TableTwo.com" title="http://TableTwo. " target="_blank">TableTwo.com</a>monID

 

Tchywallace   220 pts.  |   Nov 5 2009  12:19PM GMT

update TableOne, TableTwo
    set TableOne.field1 = TableTwo.fieldX
    where <a href="http://TableOne.com" title="http://TableOne. " target="_blank">TableOne.com</a>monID = <a href="http://TableTwo.com" title="http://TableTwo. " target="_blank">TableTwo.com</a>monID

 

Tchywallace   220 pts.  |   Nov 5 2009  12:20PM GMT

Why, we are the problem when i sent a code

 

Tchywallace   220 pts.  |   Nov 5 2009  1:46PM GMT

create or replace procedure testproc

begin
update data_admin set first_name = ‘&pval’
where id_admin = 3

update tbl_admin set password = ‘&pval’
where id_user = 14
end;

there a error i don’t know where

 

Carlosdl   29855 pts.  |   Nov 5 2009  2:33PM GMT

Each statement needs to end with a semicolon.

Also, that new value needs to be declared as a parameter of the stored procedure, as shown in the example I posted. The way you have it, it would update your tables with the ‘&pval’ string, literally.

If you get more errors, please post the error messages.

 

Tchywallace   220 pts.  |   Nov 5 2009  3:35PM GMT

please how ?? because when i start my procedure with
execute testproc
the error the procedure created with compilation error

 

Carlosdl   29855 pts.  |   Nov 5 2009  4:12PM GMT

This is the command:

show errors;

 

Tchywallace   220 pts.  |   Nov 5 2009  5:50PM GMT

create or replace PROCEDURE TESTPROC (
  par in VARCHAR2, id_par in NUMBER
) AS
BEGIN
    UPDATE data_admin set first_name = par WHERE id_admin = id_par;
    UPDATE tbl_admin set login = par WHERE id_user = id_par;
    commit;
  NULL;
END TESTPROC;

this is error
Erreur commençant à la ligne 1 de la commande :
call testproc
Rapport d’erreur :
Erreur SQL : ORA-06576: ceci n’est pas un nom de fonction ou de procédure valide
06576. 00000 - “not a valid function or procedure name”
*Cause: Could not find a function (if an INTO clause was present) or
a procedure (if the statement did not have an INTO clause) to
call.
*Action: Change the statement to invoke a function or procedure

 

Carlosdl   29855 pts.  |   Nov 5 2009  8:27PM GMT

1) Where are you calling this procedure from ?
2) Can you post the instruction you are using to call the procedure ?

Have you tried running it from Sql*Plus this way ?

execute testproc(’test’,1);

 

Tchywallace   220 pts.  |   Nov 6 2009  12:20PM GMT

no i have just use execute testproc and it’s was finish i thinks

 

Tchywallace   220 pts.  |   Nov 6 2009  12:35PM GMT

Yes it’s great

 

Tchywallace   220 pts.  |   Nov 6 2009  4:03PM GMT

And on visual basic how can you call this procedure

 
0