collin varallo and devin grissom dating - Selecting from and updating the same table oracle

by  |  27-Apr-2017 23:51

We currently use GET DIAGNOSTICS to determine how many rows were affected (to determine success). Thanks An interesting 'by-product' of the above statement (Not sure if this is documented somewhere) with TMP1 as ( select * from old table (UPDATE sometbl1 where ....) as x1 ), TMP2 as ( select * from final table (DELETE FROM sometbl2 where P1. P1...) as x2 ), TMP3 as ( select * from final table (insert into XXXX select * from TMP3) x3 ) select count(*) from TMP3; You can do multiple Insert/Update/Delete operations in a single statement. with tmp1 as ( select * from old table (update fact.t1 set current_fl='N' where pk=1)), tmp2 as ( select * from final table(insert into fact.t1 values(1, 'Y')) ) select 1 from sysibm.sysdummy1 Cheers Sathyaram If you already have the testbed with the stored procedure, you= may want to try the SQL Profiler=2E It will give you roughly the= amount of time spent on each line in your SQL Stored Procedure= (with added overhead for running the event monitor to gather the= data)=2E Here is a link to the SQL Profiler= -0406rielau/ Please post back to let us all know how it turns out=2E I tried the following SQL. I just start catching some of the comments posted and very surprised to see that Chris Eaton posted "DB2 only locks rows (unless you explicitly ask for a full table lock) never locks pages." Am I reading it right?

selecting from and updating the same table oracle-43

Selecting from and updating the same table oracle

I understand that approach I want to use not so trivial and this statement was designed for other purposes...

May be someone could help me with this problem: How to get an ID value after the insert to view. Evgeny Disclaimer: Blog contents express the viewpoints of their independent authors and are not reviewed for correctness or accuracy by Toolbox for IT.

The UPDATE portion of the code works in an identical fashion to the Implicit Cursor Loop, so this is not really a separate "UPDATE" method as such.

The interesting thing about this method is that it performs a context-switch between PL/SQL and SQL for every FETCH; this is less efficient.

I include it here because it allows us to compare the cost of context-switches to the cost of updates.

Community Discussion