Could you please point me in the right direction?
Are there any examples?
in my case, I simply want to do something similar to getting the row count from the menu above.
I hope to have it gen a simple qry from dba_segments to get the table size (in MB)
...or gen the sql to do so via the menu
Thank you Sir. I was looking over several examples. This is helpful.
such as this one
I wanted to dig into the xml syntax a bit more, however I found relevant links on this page no longer valid:
The bad links are below
ps: I am also a java developer, so I will also look into the java extensions also. But for now, I think a simple xml extension will do.
pss: I did find some of your (and others) awesome docs:
if you need help, feel free to post them to the github project, our developer is there to answer questions and make suggestions
ok thank you
I have a working right-click menu option now (with help and confirmation window/popup)
however my test does a simple DML.
What I hope to do is show the results of a query on the confirmation window
to a query/sql such as
'select num_rows from all_tables where...."
I am not sure how to show query/sql results (from a right-click context action)
if I post this question on the github, how should I do it?
yes, as an issue
I always have trouble searching inside jar files for strings, but if you look inside of your SQL Developer installation's
file and look for
you will find the following syntax example for the Table context menu's Table > Count rows... option:
Rather than #O.CNT#, I assume you will need to use the appropriate column name (or alias, if the result is a calculated expression).
Hope this helps
Thank you all for your help (and to bjeffrie on github)
Here is my final/working version:
<items><folder type="TABLE"> <name>Doc`s context menu</name>
<item type="TABLE"> <title>Show table size</title>
<prompt type="confirm"><label>Get table size in MB</label></prompt>
<sql> <![CDATA[select max('ignore this') from dual ]]> </sql>
<confirmation> <title>Table size in MB</title>
<prompt>Table "#OBJECT_OWNER#"."#OBJECT_NAME#" size #0.MEGABYTES# </prompt>
<sql> <![CDATA[select sum(bytes/1024/1024)||' MB' MEGABYTES from DBA_SEGMENTS where OWNER='#OBJECT_OWNER#' and SEGMENT_NAME='#OBJECT_NAME#' ]]> </sql>
also, I had to use an aggregate function (such as max, min, sum, etc...)
so that sql developer would actually return the result (so it could be guaranteed to return only 1 row)