Quantcast
Channel: Active questions tagged cte - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 207

Generate WITH clause from resultset using SQL Developer?

$
0
0

I've run a query in Oracle SQL Developer 18.

enter image description here

I want to share the resultset data on Stack Exchange in a format that's easy for answerers to grab and use.

From my experience, WITH clauses are preferred by Stack Exchange 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 dualunion allselect 10 as asset_id, 2 as vertex_num, 118.62 as x, 1.03 as y from dualunion allselect 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.


Is there equivalent functionality in SQL Developer — to automatically generate a WITH clause from the resultset? Or are we stuck writing WITH clauses manually?


Viewing all articles
Browse latest Browse all 207

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>