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


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


Back to the top