Oracle table update exist ?

220 pts.
Tags:
Oracle Tables
Oracle upgrades
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

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 23  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    You can't update more than one table with a single update statement. Why do you need to do this ?
    69,225 pointsBadges:
    report
  • Tchywallace
    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
    220 pointsBadges:
    report
  • carlosdl
    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.
    69,225 pointsBadges:
    report
  • Tchywallace
    i want to show the picture of my database i don't how i can insert in this
    220 pointsBadges:
    report
  • Tchywallace
    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
    220 pointsBadges:
    report
  • Tchywallace
    gestock
    220 pointsBadges:
    report
  • Tchywallace
    Gestock
    220 pointsBadges:
    report
  • Tchywallace
    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
    220 pointsBadges:
    report
  • carlosdl
    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;
    69,225 pointsBadges:
    report
  • Tchywallace
    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 TableOne.commonID = TableTwo.commonID With the case on MySQL server there are no problem also oracle .... @@@ERROR@@@ If you thinks your sintax is good i want try
    220 pointsBadges:
    report
  • Tchywallace
    I don't there are always a problem when i want post a msg update TableOne, TableTwo set TableOne.field1 = TableTwo.fieldX where TableOne.commonID = TableTwo.commonID
    220 pointsBadges:
    report
  • Tchywallace
    update TableOne, TableTwo set TableOne.field1 = word1, TableTwo.field =world2 where TableOne.commonID = TableTwo.commonID
    220 pointsBadges:
    report
  • Tchywallace
    update TableOne, TableTwo
        set TableOne.field1 = TableTwo.fieldX
        where TableOne.commonID = TableTwo.commonID
    220 pointsBadges:
    report
  • Tchywallace
    Why, we are the problem when i sent a code
    220 pointsBadges:
    report
  • Tchywallace
    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
    220 pointsBadges:
    report
  • carlosdl
    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.
    69,225 pointsBadges:
    report
  • Tchywallace
    please how ?? because when i start my procedure with execute testproc the error the procedure created with compilation error
    220 pointsBadges:
    report
  • carlosdl
    This is the command:
    show errors;
    69,225 pointsBadges:
    report
  • Tchywallace
    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
    220 pointsBadges:
    report
  • carlosdl
    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);
    69,225 pointsBadges:
    report
  • Tchywallace
    no i have just use execute testproc and it's was finish i thinks
    220 pointsBadges:
    report
  • Tchywallace
    Yes it's great
    220 pointsBadges:
    report
  • Tchywallace
    And on visual basic how can you call this procedure
    220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following