|
|
Re: Using the SQL Query Builder UI [message #653937 is a reply to message #653853] |
Fri, 11 February 2011 23:25 |
Brian Payton Messages: 154 Registered: July 2009 |
Senior Member |
|
|
You can open the SQL Query Builder either as an editor or as a dialog.
Here's how to open it both ways in the DTP UI. To open the SQB as a
dialog, first open the SQL editor, then launch the SQB from a DML
statement in the editor. Here are steps:
1. Make sure you have an active database connection. (Let's call it
TESTDB.)
2. Make sure the Project Explorer view is open.
3. Create a project. (A General project will do.)
3. Do a New -> SQL File action. In the New SQL File wizard, associate
the editor with TESTDB.
4. In the SQL editor, enter a valid DML (query) statement, such as
"select lastname from employees".
5. Select the query statement text, right-click, and do a "Edit in SQL
Query Builder..." action. This should launch the SQB on the statement.
To open the SQB as an editor, you can right-click on a .sql file that
contains a single DML statement and do an Open With -> SQL Query Builder
action. For example, let's assume you have done the above steps, and
have closed the SQL editor and saved the query statement above in a file
named test.sql in your project. Then simply right-click on test.sql and
do the Open With -> SQL Query Builder action.
On a programmatic level, the SQL Query Builder plugin registers itself
as an editor on files with a .sql extension. See the plugin.xml file of
the org.eclipse.datatools.sqltools.sqlbuilder plugin.
To see how the SQB is launched as a dialog, see the following:
- the run method in class DMLDialogSelectionSQLAction in plugin
org.eclipse.datatools.sqltools.sqleditor
- the getDMLDialog method in class UIComponentService in plugin
org.eclipse.datatools.sqltools.editor.core.ui
- the getDMLDialog method in class SQLBuilderUIComponentService in
plugin org.eclipse.datatools.sqltools.sqlbuilder
On 2/11/2011 6:55 AM, akoeck@gmx.de wrote:
> I found this http://wiki.eclipse.org/SQL_Query_Builder_Component_API
>
> But I'm not quite sure how I open the Query Builder UI and how i create
> my own sql.
>
> Hope someone out there can hel me.
>
> Regards
> Alexander
|
|
|
Re: Using the SQL Query Builder UI [message #654115 is a reply to message #653937] |
Mon, 14 February 2011 09:25 |
akoeck Messages: 62 Registered: December 2010 |
Member |
|
|
Do't know if this really helps me.
I want to combine it with an GMF Editor. When I run my creation tool a
dialog should open where the user can choose to write the SQL per hand
or to use the Query Builder for Intersect, Union or Minus.
This is my problem and I don't exactly know how to solve this. I mean
the code snippets are good, but I don't know how to bring them together.
Am 12.02.2011 00:25, schrieb Brian Payton:
> You can open the SQL Query Builder either as an editor or as a dialog.
>
> Here's how to open it both ways in the DTP UI. To open the SQB as a
> dialog, first open the SQL editor, then launch the SQB from a DML
> statement in the editor. Here are steps:
> 1. Make sure you have an active database connection. (Let's call it
> TESTDB.)
> 2. Make sure the Project Explorer view is open.
> 3. Create a project. (A General project will do.)
> 3. Do a New -> SQL File action. In the New SQL File wizard, associate
> the editor with TESTDB.
> 4. In the SQL editor, enter a valid DML (query) statement, such as
> "select lastname from employees".
> 5. Select the query statement text, right-click, and do a "Edit in SQL
> Query Builder..." action. This should launch the SQB on the statement.
>
> To open the SQB as an editor, you can right-click on a .sql file that
> contains a single DML statement and do an Open With -> SQL Query Builder
> action. For example, let's assume you have done the above steps, and
> have closed the SQL editor and saved the query statement above in a file
> named test.sql in your project. Then simply right-click on test.sql and
> do the Open With -> SQL Query Builder action.
>
> On a programmatic level, the SQL Query Builder plugin registers itself
> as an editor on files with a .sql extension. See the plugin.xml file of
> the org.eclipse.datatools.sqltools.sqlbuilder plugin.
>
> To see how the SQB is launched as a dialog, see the following:
> - the run method in class DMLDialogSelectionSQLAction in plugin
> org.eclipse.datatools.sqltools.sqleditor
> - the getDMLDialog method in class UIComponentService in plugin
> org.eclipse.datatools.sqltools.editor.core.ui
> - the getDMLDialog method in class SQLBuilderUIComponentService in
> plugin org.eclipse.datatools.sqltools.sqlbuilder
>
> On 2/11/2011 6:55 AM, akoeck@gmx.de wrote:
>> I found this http://wiki.eclipse.org/SQL_Query_Builder_Component_API
>>
>> But I'm not quite sure how I open the Query Builder UI and how i create
>> my own sql.
>>
>> Hope someone out there can hel me.
>>
>> Regards
>> Alexander
|
|
|
|
|
Re: Using the SQL Query Builder UI [message #657247 is a reply to message #657241] |
Wed, 02 March 2011 07:35 |
akoeck Messages: 62 Registered: December 2010 |
Member |
|
|
Ok, I try to explain it form the beginning.
I need to have a GUI for the user to build INTERSECT, MINUS and UNION queries for MySQL. UNION is not the problem. Since there is no INTERSECT and MINUS supportet in MySQL the user should only "build" the query via an visual editor. So this is where comes your Query Builder into the game.
But, i don't really know how tu use your UI, and also I don't know if I can use there my own "SQL Building (Joins insetad of Intersect and Minus)", I'm also using temporary tables, and I don't know if I could select them with your UI.
Also I don't really need everything from the Query Builder Dialog. Only the marked area and there I really need the part where the tables and statement types are shown.
But there I don't exactly know which visual components are used there to build the editorarea and the tables and connections within.
This is what I'm asking. I mean when you tell me this is all easier to achieve with your Query Builder i would use it, but if not, i need to know how to build the editor.
Thanks in advance.
Brian Payton wrote on Wed, 02 March 2011 00:32 | I'm not quite sure what you are asking for here. Can you explain in a
little more detail?
On 3/1/2011 11:03 AM, akoeck@gmx.de wrote:
> I've decided to create a simple GUI on my own. But therefore I want to
> know which visual elements are used in the area where I "build" my query
> with the visual elements.
|
[Updated on: Wed, 02 March 2011 07:36] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04124 seconds