multiple sql in uv stage

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
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

multiple sql in uv stage

Post by spracht »

Hello folks,

I'm trying to issue multiple sql statements (as user defined sql) in a uv stage to drop and (re-)create a table and subsequently create secondary indices. I know that I can drop and create by enabling the correspondent controls. But whith user defined sql, statements separated by semicolon, I get error messages:

With each statement on separate lines, DS complains about something displayed like a pipe '|'. Having all statement on one line, CREATE (after the first semicolon) is said to be unexpected?

I hope somebody of you is ready to reveal the secret :) .
Kind Regards
Stephan
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

Post by spracht »

As a workaround, I created three separate input links to the uv-stage to each execute one single sql.
Kind Regards
Stephan
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Use a before routine. Much cleaner. Issue an execute statement for each line and not as all one string.

Kim.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Here's another approach, provided there are no job parameters in the SQL.
Execute both/all SQL statements from your Administrator client Command window. Then select them and Save. (The selected SQL statements will be saved as a "paragraph" in the VOC file of the project. You will be prompted for the name under which to save.)
In the user-defined SQL of the UV stage, simply name this paragraph. (You may need to precede it with CALL - the paragraph is being invoked as a stored procedure.)
Post Reply