For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > June 2004 > output parameters in prepared statement









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author output parameters in prepared statement
Al Partis

2004-06-24, 3:55 pm

How do I specify an output parameter in a prepared statement?

I'm calling a stored procedure on a remote DB2 database that takes two arguments: one input argument and one output argument. The stored proc returns a result set.

How do I specify the output parameter in my PHP code?

Here's what I have so far (I've tried numerous variations, but none of them work):


$rc = 99;

$args = array($client_nbr, ':$rc');
$query = "call WEB001SP (?, !)";
$pstmt = $db->prepare($query);
$rs = $db->execute($pstmt, $args);


This solution results in the following error statement from DB2:

[DB2 UDB]SQL0312 - Variable $RC not defined or not usable.

Any thoughts?


________________________________________
________________
Alan Partis
thundernet development group
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com