Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dtp-dev] Executing SQL Statements In SQL Results View


Larry,
        Sure, we can move it from o.e.d.sqltoolg.sqleditor to o.e.d.sqltoolg.editor.core.

Best Regards!

Max (Hui) Cao
Sybase Shanghai RD



Lawrence E Dunnell <ledunnel@xxxxxxxxxx>
Sent by: dtp-dev-bounces@xxxxxxxxxxx

01/03/2008 05:36 AM

Please respond to
DTP development mailing list <dtp-dev@xxxxxxxxxxx>

To
DTP development mailing list <dtp-dev@xxxxxxxxxxx>
cc
Subject
Re: [dtp-dev] Executing SQL Statements In SQL Results View






Max,


That works great.  It provides the exact behavior I need.  The only problem is that it creates a dependency on the
org.eclipse.datatools.sqltools.sqleditor plug-in which I need to avoid.  Can GroupSQLResultRunnable and its dependencies be moved from  the org.eclipse.datatools.sqltools.sqleditor plug-in?  Should I open a defect for this?

Larry Dunnell
DB2 Tooling, RAD Data Tools and Eclipse Data Tools Project (DTP)
IBM DB2 Information Management Software



From: Hui.Cao@xxxxxxxxxx
To: DTP development mailing list <dtp-dev@xxxxxxxxxxx>
Date: 12/23/2007 09:35 PM
Subject: Re: [dtp-dev] Executing SQL Statements In SQL Results View







Hi Larry,

      You can do it this way (copied from
BaseExecuteAction):
          SQLDevToolsConfiguration f = SQLToolsFacade.getConfigurationByProfileName(databaseIdentifier.getProfileName());


          String[] groups = new String[]
          {

              sql

          }

          ;

          //not needed if you already have a String Array

          SQLService sqlService = f.getSQLService();

          if (sqlService != null)

          {

              groups = sqlService.splitSQL(sql);

          }


          //don't pass in connection, let GroupSQLResultRunnable create and close the connection

          _job = new GroupSQLResultRunnable(null, groups, null, null, databaseIdentifier, false, getVariableDeclarations(), Messages.BaseExecuteAction_group_exec_title, "SQL Editor");//Change "SQL Editor" to anything you want

          _job.setName(Messages.BaseExecuteAction_job_title);

          _job.setUser(true);

          //don't call job.join() to prevent blocking eclipse

          _job.schedule();


Best Regards!

Max (Hui) Cao
Sybase Shanghai RD

Lawrence E Dunnell <ledunnel@xxxxxxxxxx>
Sent by: dtp-dev-bounces@xxxxxxxxxxx

12/22/2007 04:34 AM

Please respond to
DTP development mailing list <dtp-dev@xxxxxxxxxxx>


To
dtp-dev@xxxxxxxxxxx
cc
Subject
[dtp-dev] Executing SQL Statements In SQL Results View










SQLTools Developers,


I am adding the capability to execute the generated DDL against a database server from the Generate DDL wizard.  I have a connection and string array of SQL statements.  I would like to execute each command separately so that the results show for each command in the SQL Results view.  Is there a recommended way of doing this?


Larry Dunnell
DB2 Tooling, RAD Data Tools and Eclipse Data Tools Project (DTP)
IBM DB2 Information Management Software

_______________________________________________
dtp-dev mailing list
dtp-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/dtp-dev
_______________________________________________
dtp-dev mailing list
dtp-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/dtp-dev
_______________________________________________
dtp-dev mailing list
dtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dtp-dev


Back to the top