I'm trying to use the return value from the UDF in the select statement. My
though was the "?" parameter marker was for the input variable since the
output variable is the return value.


On Wed, Feb 6, 2013 at 1:18 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:


On Wed, 6 Feb 2013, at 12:42 PM, Michael Ryan <michaelrtr@xxxxxxxxx>
wrote:

When I try and use it like this:

$SQLStmt = "SELECT * from cusmstp where NEWSYS.MSP_ValidateStoreFN(cast
(?
as char (3) ) ) = '666'";
$prepare = db2_prepare($db2connection, $SQLStmt);
//db2_bind_param($prepare, 2, "$Wk_Error", DB2_PARAM_OUT);
db2_bind_param($prepare, 2, "$Wk_Store", DB2_PARAM_IN);
db2_bind_param($prepare, 1, "$Wk_Error", DB2_PARAM_OUT);
$stmt = db2_execute($prepare) or die("Failed SQL
Stmt:".$SQLStmt.":".db2_stmt_error().":".db2_stmt_errormsg());

Just noticed that you are binding two parms but I only see one "?" in the
SQL statement. Surely the return value will be in the result set - not a
parm? Haven't actually tried to do this myself but it just looks wrong.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com




--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.