Skip to Main Content

Idea: Generate WITH clause from resultset

User_1871Feb 8 2022

I've run a query in Oracle SQL Developer:
image.pngScenario:
I want to share the resultset data on a forum — in a format that's easy for answerers to grab and use.
From my experience, WITH clauses are preferred by forum members, since WITHs avoid the need to create data in a local Oracle environment.
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

Idea:
Could functionality be added to SQL Developer that automatically generates a WITH clause from the resultset?

Comments
Post Details
Added on Feb 8 2022
8 comments
73 views