February 28, 2025

Oracle Dynamic query creation

 

How to create oracle SQL statement from a select query

In this post, a simple yet very powerful query is written. If anytime we need to create large number of insert/update/alter statements from existing SQL statement, we can utilize the below operator to create it successfully.


Dynamic Create kill session example:


select 'alter system kill session ('||sid||','||serial#||');' from v$session where sid in (
select lo.SESSION_ID
from gv$locked_object lo, dba_objects do
where lo.object_id = do.object_id);


Best Wishes!! 

No comments:

Post a Comment

If you have any queries/ any suggestion please do comment and let me know.

Recent Post

Check progress on expdp and impdp

 Check progress on expdp and impdp: In few cases we need to monitor the progress of an export or import job in oracle. below are the steps c...