Sql updating multiple columns from another table

COMP_BLOOMBERG_CODE = xls01.col1), COMP_AMS_STOCK_BETA=( SELECT col19 FROM xls01 WHERE INVST_COMPANY. Nah, in definition portion we have c0 ref cursor; c1 c0; then somewhere I need to define a variable that holds the rowtype for that unknown yet ref cursor. COMP_BLOOMBERG_CODE = xls01.col1), COMP_AMS_DIVIDEND_YIELD=( SELECT SUBSTR(col18,1, INSTR(col18,'%')-1) FROM xls01 WHERE INVST_COMPANY. Use a naming convention so it would be easy to read these out - dynamically execute them - and then drop them later. I don't think i can use the merge statement here since there are more than 1 condition that has to be met for the target table to be updated. The way i understand it external tables don't have primary keys. Asked: June 28, 2005 - am UTC Answered by: Tom Kyte - Last updated: June 18, 2013 - pm UTC Category: Database - Version: 9.2 Viewed 100K times! I want to write SQL ( not PL/SQL ) to update transaction table from mapping table at one stroke. regards & thankspjp update ( select old.old_account_number, new.new_account_number from old_table old, mapping_table new where old.old_account_number = new.new_account_number ) set old_account_number = new_account_number;disabling foreign keys during the operation and enabling them afterward.

COMP_BLOOMBERG_CODE = xls01.col1), COMP_AMS_LTM_P_E_RATIO=( SELECT col14 FROM xls01 WHERE INVST_COMPANY. )merge into emp using (select emp.rowid rid, NVL2(test1.desc1,test1.desc1, SUBSTR(ENAME,1,5)) d1, NVL2(test1.desc1,test1.desc1, SUBSTR(job,1,5)) d2 from test1 ,emp where emp.deptno=test1.deptno( )) YOUR_QUERY on (emp.rowid = your_query.rid) when matched then update set dept_desc = d1, desc1 = d2; i am having 2 tables 1.student_master regno papercode name m1 m2 m3 total result 2. So table1 will be merged into table1_new, but would like to write generic procedure/package for all 200 at once and not 200 procedures.By commenting, you are accepting the DISQUS terms of service.The Ask TOM team will be busy at Open World this month. WORKEXTENSION from TBL_VOTERS old, VOTERSWITHNUMBERS new where old. If it is not possible can you show me how to write "GOOD" sql ? i.e, one column of a table should get updated from another column of another table. regards & thankspjp June 29, 2005 - am UTC select as many old columns as you want and as many new columns as you want??? But when i did the same with the syntax given i got this error ora-01779 cannot modify a column which maps to a non key preserved value. I tried doing the same through this update ( select old.

Leave a Reply