Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating a table on the fly?

69 views
Skip to first unread message

Chiragz

unread,
Jan 23, 2012, 11:56:48 AM1/23/12
to
Is it possible to create a table with few columns on the fly, say on a
remote DB2 database using TDI?

alchemisx yep

unread,
Jan 24, 2012, 8:24:50 AM1/24/12
to
On Jan 23, 11:56 am, Chiragz <chira...@gmail.com> wrote:
> Is it possible to create a table with few columns on the fly, say on a
> remote DB2 database using TDI?

You always have the ability to execute arbitrary SQL commands via
execSQL().

Ex: thisConnector.connector.execSQL("CREATE TABLE
<TABLE_NAME> ...")

If you have attribute variables to drop into the table you can call
them within the execSQL command.

Ex: thisConnector.connector.execSQL("CREATE TABLE " +
work.getString("someAttribute") + " ... ");

Then drop this into the connector hook that seems appropriate.

Hope this helps,

-rsxdc5

Eddie Hartman

unread,
Feb 1, 2012, 4:39:52 AM2/1/12
to
Note also that the Database Connector will auto-create the table if
you have the connection option selected: Auto-create table. Although
you will have less control than if you issue your own DDL as rsxdc5
suggests.

-Eddie

Chiragz

unread,
Feb 16, 2012, 4:18:31 AM2/16/12
to
Thanks, this was pretty useful!

Chris

unread,
Feb 16, 2012, 4:24:40 PM2/16/12
to
> Thanks, this was pretty useful!- Hide quoted text -
>
> - Show quoted text -

And, check one post or so up. If you're just looking for a place to
park some data for awhile, the built-in Derby database works really
well too.
0 new messages