On 9/10/07, Patrick Niemeyer <pa...@pa...> wrote:
> First - thanks for the fantastic tool. I use it every day.
>
> I was just wondering - is there a way to export selected rows or the
> result of a query as sql insert statements?
> I see that I can dump a whole table to sql using the create data script.
In the SQL editor, type the query that limits the rows. Then place
your cursor in the query, and type Ctrl-T to access the tools popup.
Next type "sql2ins" - without the quotes : this stands for
sql-to-insert statements. The insert statement should appear at the
end of the editor.
> If not perhaps I can try to add this feature and submit it.
Perhaps another approach could be to set a "Contents Tab SQL filter"
on the table, then right-click to "Create Data Script" could take into
account the filter criteria. It doesn't currently -
CreateDataScriptCommand.java is the file, if you have time and want to
look. The IObjectTreeApi doesn't provide a good way to get access to
the ContentTab which contains the method getSQLFilterClauses - it
needs to support getting a particular type of tab - the "Contents"
tab; right now it only supports getting a tab by title - not by
purpose. If you would like to study the code a little and suggest an
improvement we would be happy to listen.
Rob
|