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 163710 - [67cat] View Data action query should contain a semicolon in generated sql query string
Summary: [67cat] View Data action query should contain a semicolon in generated sql qu...
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: NETFIX
Depends on:
Blocks:
 
Reported: 2009-04-27 07:31 UTC by rajivderas
Modified: 2012-10-16 02:05 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rajivderas 2009-04-27 07:31:44 UTC
using Dev (Build 200904261401)
1) connect to the sample derby database
2) perform a select statement to one of the tables by right clicking the the table and selecting view data action will 
place a sql query in the sql editor without the semicolon at the end of the line.
ex: select * from APP.MANUFACTURER
3) now keep the curson at the end of the select statement and click on the sql history and insert a valid sql query in 
the sql editor which will place a query with the semicolon
ex;select * from APP.CUSTOMER;
4) now run the query and it will fail because the query generated from view data action didnt had a semicolan to its 
end of line which resulted in appending the sql history query to it which ultimatley breaks the query syntax.

so the view data action query should contain a semicolon as well since when you apply this semicolon and run it will 
display resulting data from the two queries in separate data view table tabs.
Comment 1 Jiri Rechtacek 2009-04-30 15:43:53 UTC
As same behavior as in NB6.5, changing to RFE for the next release.
Comment 2 Jiri Rechtacek 2009-10-16 14:15:54 UTC
Reassigned to new owner.
Comment 3 matthias42 2012-10-13 10:55:40 UTC
The fix is not that invasive - this needs adjustment in the "Database Explorer" module (db), which contains the class:

org.netbeans.modules.db.explorer.action.ViewDataAction

line 84 needs to be ajusted:

SQLEditorSupport.openSQLEditor(connection.getDatabaseConnection(), expression, true);

I would change it to:

SQLEditorSupport.openSQLEditor(connection.getDatabaseConnection(), expression + ";\n", true);

This also inserts a newline character, which I as a user would prefer.
Comment 4 Jaroslav Havlin 2012-10-15 12:07:50 UTC
http://hg.netbeans.org/core-main/rev/58d032b9c6bc
Fixed. Thank you.
Comment 5 Quality Engineering 2012-10-16 02:05:22 UTC
Integrated into 'main-golden', will be available in build *201210160002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/58d032b9c6bc
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #163710: View Data action query should contain a semicolon in generated sql query string