|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Calling PROCEDURE or FUNCTION |
« View previous topic :: View next topic » |
Author |
Message
|
neo_revolution |
Posted: Mon Sep 27, 2004 4:08 am Post subject: Calling PROCEDURE or FUNCTION |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
Hello,
I have a set of esql 'SET' statements which are repeating many times. I wanted them to put in a PROCEDURE or FUNCTION so that I can call them when required.
I saw the documentation, it seems PROCEDURE is well suited in my case as the function should return some return value. I have to pass 4 attributed to the PROCEDURE. But there are only 3 pre-determined variables for a PROCEDURE (IN, OUT, INOUT).
Any idea how to proceed? Thanks. |
|
Back to top |
|
 |
mgk |
Posted: Mon Sep 27, 2004 4:29 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
I think you have misunderstood the documentation. The IN / OUT / INOUT heywords are not variables, they are direction qualifiers applied to variables, that allow you to change (or not) the variables passed into the procedure. You can have any number of variables (from 0 upwards) passed to each procedure.
E.G.
CREATE PROCEDURE test( IN p1 INT, IN p2 INT, IN p3 CHAR, INOUT p4 INT, OUT p5 INT) ...
Shows a procedure called test that takes 5 parameters of varying directions. Please re-read the docs for the CREATE PROCEDURE and CALL statements if this is still not clear.
Note that unless you are on V5.0 Fix Pack 4, procedures cannot RETURN a value other than by an OUT or INOUT direction parameter. After FP4 procedures can have a RETURNS clause just like functions can...
Cheers, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
neo_revolution |
Posted: Mon Sep 27, 2004 9:10 am Post subject: |
|
|
Voyager
Joined: 21 Oct 2003 Posts: 80 Location: NJ
|
|
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
|
|
|
|