Skip to Main Content

Java Database Connectivity (JDBC)

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!

Generate WITH clause from resultset using SQL Developer?

User_PBFCFFeb 9 2022 — edited Aug 28 2022

I've run a query in Oracle SQL developer 18.
1.pngFrom my experience, WITH clauses are preferred by community members, since WITHs avoid the need to create data in a local oracle environment.
WITHs are also easy to paste into db<>fiddle.
Example:

with cte as(
select 10 as asset_id, 1 as vertex_num, 118.56 as x, 3.8 as y from dual
union all
select 10 as asset_id, 2 as vertex_num, 118.62 as x, 1.03 as y from dual
union all
select 10 as asset_id, 3 as vertex_num, 121.93 as x, 1.03 as y from dual)

 --There are lots more rows. But it's too much work to write them all out.
   
select * from cte

Back when I was using Toad 12 for Oracle, I remember having an export option for generating a WITH statement from a resultset. Which was really handy to play traffic rider mod apk v1.81.1
Is there equivalent functionality in SQL Developer — to automatically generate a WITH clause from the resultset? Or are we stuck writing WITH clauses manually?

Comments
Post Details
Added on Feb 9 2022
2 comments
253 views