Input to a stored Procedure

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Input to a stored Procedure

Post by mab_arif16 »

Hi
I it possible to give an sequnetial file as input to a stored procedure.I want to pass file data as input to the procedure parameters .
If it is possible then what will be the syntax in stored procedure
Thanks
Arif
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your job will parse each line from the sequential file into a row (a set of columns). These can then be transformed/enriched within the DataStage job, which continues to pass rows through the job design. When you invoke your stored procedure, you do so once for each row processed, supplying column values from the input row to the stage from which you invoke the SP to replace the stored procedure's arguments.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Not abel to view content

Post by mab_arif16 »

Hi Ray
I have just bought the membership for charter members ,but still I am not able to view all the contents ,do you have any idea how much time it will take to activate the membership.
Thanks
Arif
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you using the actual Stored Procedure stage or some other mechanism?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Not abel to view content

Post by ray.wurlod »

mab_arif16 wrote:Hi Ray
I have just bought the membership for charter members ,but still I am not able to view all the contents ,do you have any idea how much time it will take to activate the membership.
Thanks
Arif
I thought it was immediate. Contact either the Editor or the Webmaster (choose Contact from the menu at top). You may, however, need to re-connect to pick up the new setting.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Syntax for input column

Post by mab_arif16 »

Hi Ray
If the input columns are col1,col2 ...etc. from input files , and the parameters to stored procedure are @ input1,@input2..etc
In the syntax to call the procedure
Will the syntax of stored procedure be #procedurename#@input1=col1,@input2=col2 or
#procedurename#@input1=DSLink.col1,@input2=DSLink.col2
OR in the parameters tab of SP stage we have to map the output column name to the parameters name .
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Post by mab_arif16 »

I am using the actual stored procedure stage .I dont think it is possible to give an input to the ODBC stage which calls stored procedure.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Re: Syntax for input column

Post by DSguru2B »

mab_arif16 wrote: Will the syntax of stored procedure be #procedurename#@input1=col1,@input2=col2 or
#procedurename#@input1=DSLink.col1,@input2=DSLink.col2
OR in the parameters tab of SP stage we have to map the output column name to the parameters name .
In the SP stage you will have to map the column. The input columns like as mentioned will be parsed to the input columns of your SP.
The tabs in the stage explicitly allow you to enter them.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
mab_arif16
Charter Member
Charter Member
Posts: 87
Joined: Sat Mar 18, 2006 11:45 pm

Procedure call syntax , map to column in Stored procedure

Post by mab_arif16 »

Hi guru
I have tried to give the input column name in maps to column in parameter tab,but I am getting error ,is there some changes needed to be done to done to procedure call syntax in the SP stage as well.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

In the stored procedure stage under the
Stage tab - > Parameters:
Enter the all the parameters. Meaning that all your inputs to the Stored Procedure and output to the stored procedure. Give the type of each one accordingly ie; input,output,function.. .

Stage tab -> Syntax
Give the procedure name
for eg: #pDbSchema#.dstage_batch_activate.activateBatch
and check mark Generate Procedure call.
You will see the generated syntax of the call statment made by the stage.

Then under the Input Tab -> General:
Check mark Execute procdure for each row and set transaction size as required.
Then goto the Input tab -> Column
Your input column should appear there.

Do the similar settings for the Output tab.
If your procedure is returning multiple rows then you need to give the End of Data code that your procedure will return.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply