Executing standalone SQL statement

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gmorgen1
Premium Member
Premium Member
Posts: 12
Joined: Sat Nov 11, 2006 2:13 pm

Executing standalone SQL statement

Post by gmorgen1 »

Can I execute a standalone SQL statement in an ODBC stage without having to attach a dummy transform stage?

Or is the preferred (and only) approach to utilize a Stored Procedure stage?
dsscholar
Premium Member
Premium Member
Posts: 195
Joined: Thu Oct 19, 2006 2:45 pm

Re: Executing standalone SQL statement

Post by dsscholar »

I dont think that's possible. You need to have a output link from the ODBC stage to execute the SQL
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's not possible. Passive stages, like the ODBC stage, only expose methods for performing tasks. Active stages, like Transformer stages, generate processes that actually invoke those methods.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gmorgen1
Premium Member
Premium Member
Posts: 12
Joined: Sat Nov 11, 2006 2:13 pm

Post by gmorgen1 »

How would I then exectue a series of truncate table and insert statements in a job?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Separate jobs. To truncate a table, generate just one row (to trigger the operation) and use user-defined SQL. Or, if the stage type permits, choose "truncate table then insert rows" as the load method, so that you don't need to re-invent the wheel.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply