|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
calling database stored procedures |
« View previous topic :: View next topic » |
Author |
Message
|
javaforvivek |
Posted: Mon Jul 26, 2004 6:56 am Post subject: calling database stored procedures |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
Hi,
I am working on WBIBM5.0 CSD 3 level.
Is there any other way to call the database stored procedures apart from using 'passthru' statements?
My backend is SQLServer 2000. Currently I am using
Code: |
PASSTHRU('exec stored_proc(...)');
|
_________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
kirani |
Posted: Mon Jul 26, 2004 7:58 am Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Take a look at CREATE PROCEDURE ... statement. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
javaforvivek |
Posted: Mon Jul 26, 2004 8:34 am Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
If I have a stored procedure as:
Code: |
proc_LogDetails( ( @batch_id integer = null,
@event_code char(10) = null
)
|
In my SQLServer,
then I have written code (in ESQL) as:
Code: |
create procedure (IN batchId integer, IN eventCode character)
begin
CALL proc_LogDetails batchId,eventCode;
|
Code: |
But this gives me error: Routine
'proc_LogDetails' is not declared for these arguments |
what is worng in this code? _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jul 26, 2004 8:45 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I don't think you can call SQLServer stored procedures using Create Procedure. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
javaforvivek |
Posted: Mon Jul 26, 2004 8:49 am Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
Jeff,
So i have to use PASSTHRU statement, huh? PASSTHRU is working fine here. _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
kirani |
Posted: Tue Jul 27, 2004 4:16 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Your ESQL code is not correct. You need to use EXTERNAL keyword to specify that it's an external DB procedure. At least I did not see it documented anywhere that you cannot call a stored procedure in SQL Server. Take a look at WBIMB documentation for some sample code.
Code: |
CALL swapParms( inputParm, outputParm, inputOutputParm );
CREATE PROCEDURE swapParms (
IN parm1 CHARACTER,
OUT parm2 CHARACTER,
INOUT parm3 CHARACTER
) EXTERNAL NAME dbSwapParms;
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|