Call Stored Procedure and receive ODBC SQL messages

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
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Hi

The reason could be becos the procedure sends two output out of which datastage gets the last output regardless whatever is been done before. Either you could take out the Print command or try to call two procedures (which is not efficient).

Thanks
Siva
Sandra
Participant
Posts: 3
Joined: Tue Jul 13, 2004 3:21 pm

Post by Sandra »

Hi,

We have many such update and print statements in the procedure.
What we are trying to do is, capture how many records / rows affected for each of the SQL statements and also get the corresponding 'print' messages from the procedure.

So that when the user looks at the log, they will know the results.

Thanks,
Sandra
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

If you have multiple sql and want to capture all the result then try to output to a file and once the procedure is finished read the file and put it in the output log.

Cheers
Siva
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

Hi

Inside the procedure (if MS SQL or Oracle or Sybase) don’t return string value return 1 or 0 for validation ok. Please use following way

[code][b]Alter PROCEDURE dbo.UpdatedAuthors
AS
BEGIN

UPDATE authors
SET au_fname = 'Annie'
WHERE au_fname = 'Anne'

IF @@ROWCOUNT = 0

Return 0

End

END[/b][/code]

Don’t use print stmt in SP.
Post Reply