This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[ BUILD # : 200808170243 ] [ JDK VERSION : 1.6.0_07 ] Provide a button to export SQL Statements listed in the SQL History window. It would be nice to have a button in the SQL History window that triggers the SQL statements displayed to be copied to the clipboard or output to a plain text file where each sql statement would be on its own line (without the date). You can select one or more SQL statements in the data grid and use copy-paste to paste them into a file yourself, but if the SQL statement is long (and doesn't fully display in the data grid), then the entire SQL statement is NOT included in the copy-paste. An Export feature with a button would be more standard and intuitive for users.
Currently, if you select a row in the table, both a subset of the SQL plus the timestamp can be copied to the clipboard by selecting the rows and then using Ctrl-c to copy. If time, I'll see if the entire SQL without the timestamp can be copied.
Export can work in this way: 1) Select a connection in DB Explorer and choose Execute Statement 2) Open SQL History then select those statements to "export" then click Insert 3) The statements are exported to the SQL editor and which is saved as a file in the userdir under config/Databases/SQLCommands (the file name is in the title of the editor)
FYI, I think this is a fairly significant enhancement and I'm not sure we should be doing it right now.
There is a way to export statements by selecting several statements then inserting them in an SQL Editor won't be addressed in 7.0
Actually it is a workaround and it is inconvenient since it requires several actions.
Reassigned to new owner.
Created attachment 134656 [details] proposed patch v1 The attached patch implements Johns suggestion - copying the selected statements without including the timestamp. (comment #1) This is not a full featured export, but that was not requested - For a more advanced export you will have to add comments and so on, so Johns idea (comment #2) combined with saving the resulting document holds true.
The patch works fine. Thank you again. Applied as http://hg.netbeans.org/core-main/rev/261bee78e627
Integrated into 'main-golden', will be available in build *201305212300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/261bee78e627 User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #144507: Export SQL Statements in SQL History window Patch by Matthias42.