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.
In the SQL editor, when executing a query with unbound parameters, for example SELECT * FROM Product WHERE product_id = ? and category = ? or SELECT name FROM Product WHERE product_id = :prodId AND category = :category UNION SELECT name FROM Service WHERE product_id = :prodId AND category = :category it would be very useful for the IDE to prompt for the parameter values. For example: Please supply values for the following parameters to your SQL query: Parameter 1: _______________ Parameter 2: _______________ or Please supply values for the following parameters to your SQL query: Parameter "prod_id": _______________ Parameter "category": _______________
Yes, this is a great idea, one we've been talking about. Thanks for underscoring the value of doing something like this. If I understand right, this allows you to cut and paste SQL from your language editor (like Java) into the SQL editor to test it. Wade Chandler had similar ideas, and was proposing a tool to make this particularly easy. Let's see where we go with this...
Reassigned to new owner.
I would love to see this also. I don't include my SQL inside Java classes and instead have `.sql' resources that are read at runtime. This is very powerful for being able to test queries before packaging. This would also be helpful for other languages which use SQL files for queries. One slight enhancement for the proposal would be to remember the last used parameters so it does not always ask if the same unnamed parameters are used or same named parameters. It could be tricky though if the query is changed to alter the order of the parameters.