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

Increase Java Heap memory for OEM

 There are certain times when we observer OEM is performing slow or even unable to startup the Admin Server or OMS Server. We can look into ...