× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 4/16/2010 10:54 AM, Tom Deskevich wrote:
GLENN, can you create a working example like you did with DB2 options?

Thanks!

Tom Deskevich

Here you go...

Stored procedure:
CREATE PROCEDURE GETPROCS
(in LibName char(10))
RESULT SETS 1
LANGUAGE SQL
BEGIN

declare stmt varchar(1000);

DECLARE c1 CURSOR with hold with return to client for S1;

set stmt = 'SELECT SPECSCHEMA, SPECNAME from SYSPROCS where
SPECSCHEMA = ''' || LibName || '''';

prepare S1 from stmt;

OPEN c1;

DECLARE c1 CURSOR with hold with return to client for S1;

set stmt = 'SELECT SPECSCHEMA, SPECNAME from SYSPROCS where
SPECSCHEMA = ''' || LibName || '''';

prepare S1 from stmt;

OPEN c1;

SET RESULT SETS CURSOR c1;

END

PHP:
<?php

$user = "";
$password = "";

$i5_connection = i5_connect( '127.0.0.1', $user, $password, array(I5_OPTIONS_ATOMATIC_NEXT_RESULT=>"1") );

$storedProcedure = "call GETPROCS(?)";

$result =i5_prepare($storedProcedure);

if(!$result)

{

echo("Prepare failed");

exit();

}

// Describe first parameter

$ret = i5_paramdesc($result, I5_TYPE_CHAR, 0, 10, 0, I5_IN);

$val = "QSYS";

$ret = i5_setparam($result, 0, $val);

if(!$ret)

{

echo("Set Param failed");

exit();

}

$hdl = i5_execute($result);

echo "</br></br>";
echo "<table><tr><td>Library</td><td>Procedure</td></tr>";

while($row = i5_fetch_row( $result, I5_READ_NEXT )){
$SCHEMA = $row[0];
$PROC = $row[1];

echo("<tr><td nowrap>$SCHEMA&nbsp;</td>
<td nowrap>$PROC&nbsp;</td></tr>");
}

echo "</table>";

?>

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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.