Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update logic

cubeguySep 7 2021 — edited Sep 7 2021

Version 11.2.4
create table t1 (id number ,c1 varchar2(10),c2 varchar2(10),c3 varchar2(10),c4 varchar2(10),c5 varchar2(10),c6 varchar2(10),c7 varchar2(10),c8 varchar2(10),c9 varchar2(10),c10 varchar2(10));

insert into t1 values (100,'T11','T12','T13','T14','T15','T16','T17','T18','T19','T110');

create table t2 (oid number,c1 varchar2(10),c2 varchar2(10),c3 varchar2(10),c4 varchar2(10),c5 varchar2(10),c6 varchar2(10),c7 varchar2(10),c8 varchar2(10),c9 varchar2(10),c10 varchar2(10));

insert into t1 values (1,'T21','T22','T23',null,null,'T26','T27',null,'T29','T210');

I want to update table t1 using t2.

Logic is :
update t1 set c1 = (select c1 from t2 where oid =1 and c1 is not null) and id = 100;
update t1 set c2 = (select c2 from t2 where oid =1 and c2 is not null) and id = 100;
update t1 set c3 = (select c3 from t2 where oid =1 and c3 is not null) and id = 100;
update t1 set c4 = (select c4 from t2 where oid =1 and c4 is not null) and id = 100;
update t1 set c5 = (select c5 from t2 where oid =1 and c5 is not null) and id = 100;
update t1 set c6 = (select c6 from t2 where oid =1 and c6 is not null) and id = 100;
update t1 set c7 = (select c7 from t2 where oid =1 and c7 is not null) and id = 100;
update t1 set c8 = (select c8 from t2 where oid =1 and c8 is not null) and id = 100;
update t1 set c9 = (select c9 from t2 where oid =1 and c9 is not null) and id = 100;
update t1 set c10 = (select c10 from t2 where oid =1 and c10 is not null) and id = 100;

I need above all update statements to a single update statement

This post has been answered by Solomon Yakobson on Sep 7 2021
Jump to Answer

Comments

cormaco
Answer

You can try the Instance Viewer in SQL Developer:
SQL Developer Concepts and Usage (oracle.com)
The database instance viewer enables a DBA user to see a graphical representation of information about the instance associated with a connection. The types of information displayed include:
Database
Clients
Sessions
Processes (Counts, Execution Rate, Parse Rate, Open Cursors, Commit Rate)
Waits
Memory (DB Block Rate, Logical Reads, Allocation, Redo Generation)
Storage (Files, Redo Log)
DB CPU Ratio (database operations as a percentage of CPU activity)
Top SQL (provides performance metrics on SQL operations, which are sorted based on the CPU time required)
You can interact with the instance viewer display, including:
Panning the diagram by dragging it
Zooming the diagram in or out by using control-drag
Drilling down to a detailed display by hovering over graphical element to show a dark blue border and then double-clicking in that element
You can control the amount of history shown in graphs that include a time axis by using the Database: Instance Viewer preferences.

Marked as Answer by Ali Raza Memon · Jul 24 2022
Ali Raza Memon

Thanks for the detailed explanation. Do you know any open source one?

cormaco

Thanks for the detailed explanation. Do you know any open source one?
You are aware that SQL Developer is free (but not open source)?
Oracle SQL Developer - Oracle SQL Developer Releases
Oracle SQL Developer is a free graphical tool that enhances productivity and simplifies database development tasks.

kuljeet singh -

EM Express URL would serve the purpose.

1 - 4

Post Details

Added on Sep 7 2021
6 comments
164 views