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.
For 6.5 we want to make it easy to generate SQL statements using shortcuts within the SQL editor. Once the SQL is generated, the SQL source can be saved in an SQL file, for later reuse (by reopening the file). In 6.x, the SQL editor can save and open SQL files. In 6.5, supporting SQL generation using shortcut keys, e.g. Ctrl-Alt-I, to generate an insert statement
Another aspect of this feature is to make it easy to store and load snippets from within the SQL editor, e.g. a keyboard shortcut brings up a drop-down list and you can type to filter out possible names and see the first <n> lines of the snippet, then pick it and it pastes into your editor. Better than having to go to the File menu, browse for the SQL file, poking around your directory tree trying to find it. I'm thinking the code snippets are saved in your userdir, but the user can specify a different location if they want.
Also, SQLYog and AquaStudio both have this feature that if you select a database object like a connection or table, if you right click you have a sub-menu that lets you generate SELECT (basically View Data), INSERT, or UPDATE statements against the current object.
I'll be on leave of absence during the M2 timeframe.Not staffed.
Reassigned to new owner.
Like issue 152411 - Provide pre-defined SQL code templates in SQL editor
*** Issue 152411 has been marked as a duplicate of this issue. ***
*** Bug 65165 has been marked as a duplicate of this bug. ***
There is a working way in netbeans: Go to: Tools -> Options -> Editor -> Code Templates for example: 1. Enter "Abbreviation": "s" 2. Set "Expanded Text": "SELECT ${columns} FROM ${from}" 3. Change "Expand Template on" to "Tab" Acknowledge the dialog. Now enter an SQL Editor, enter "s" and press "Tab"-Key. now the first part is directly selected and you can enter the columns you want to select, with TAB you can jump to the next variable and with Shift-Tab you can jump back. I had to look for this, but the proposed solution in the wiki would just conflict with existing shortcuts. I'll close this as FIXED. What could be done is define a better editor for code templates, but for that bugs already exist.
Geertjan Wielenga (Twitter: @GeertjanW) created this awesome plugin for Code Templates and includes some of the SQL code templates I provided him. You can download the plugin here: http://plugins.netbeans.org/plugin/49660/?show=true List of SQL code templates I suggested he use: https://gist.github.com/phpdave/4fff31d51dd34f6e8201 Vid tutorial on using his plugin: https://www.youtube.com/watch?v=1SUHFMvM39Y