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.

Bug 144507 - [65cat] Provide Ability to Export SQL Statements in SQL History window
Summary: [65cat] Provide Ability to Export SQL Statements in SQL History window
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: NETFIX, PATCH_AVAILABLE
Depends on:
Blocks: 152828
  Show dependency tree
 
Reported: 2008-08-20 01:45 UTC by adam_myatt
Modified: 2013-05-22 02:35 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
proposed patch v1 (2.43 KB, patch)
2013-05-20 20:36 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description adam_myatt 2008-08-20 01:45:01 UTC
[ 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.
Comment 1 John Baker 2008-09-03 21:30:06 UTC
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.

Comment 2 John Baker 2008-09-23 07:16:19 UTC
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)
Comment 3 David Vancouvering 2008-09-23 16:47:18 UTC
FYI, I think this is a fairly significant enhancement and I'm not sure we should be doing it right now.
Comment 4 John Baker 2008-11-21 23:55:52 UTC
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
Comment 5 Roman Mostyka 2008-11-23 15:55:18 UTC
Actually it is a workaround and it is inconvenient since it requires several actions.
Comment 6 Jiri Rechtacek 2009-10-16 14:10:25 UTC
Reassigned to new owner.
Comment 7 matthias42 2013-05-20 20:36:58 UTC
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.
Comment 8 Jaroslav Havlin 2013-05-21 08:52:33 UTC
The patch works fine. Thank you again.
Applied as http://hg.netbeans.org/core-main/rev/261bee78e627
Comment 9 Quality Engineering 2013-05-22 02:35:01 UTC
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.