sybase asa: result set from stored procedures
Posted: Wed Feb 16, 2005 10:24 am
How I can execute stored procedure with input and output parameters and have got output parameters at result set?
More about problem:
We have database (db) on Sybase ASA. And some stored procedures in the db.
Some stored procedures looks like:
I've got result set at $result with par2 ($result['par2']).
But when I make the same query to proc2:
sybase_query work and query execute ok. I've got changes in db, but I couldn't get result set (the valume of $par2).
When I change sql query to:
When I try execute last sql-query by php, I haven't got result set again.
So how I can execute stored procedure with input and output parameters and have got output parameters at result set?
Thank's for any ideas.
(sorry for bad English)
More about problem:
We have database (db) on Sybase ASA. And some stored procedures in the db.
Some stored procedures looks like:
and some others looks like:dba.proc1 (in par1 int)
result (par2 int)
begin
...
end
When I make standart query to proc1 like:dba.proc2(in par1 int, out par2 int)
begin
...
end
Code: Select all
$resource = sybase_query("call proc1('". $par1 ."')");
$result = sybase_fetch_array ($resource);But when I make the same query to proc2:
Code: Select all
$resource = sybase_query(''call proc2 ('". $par1 ."', '". $par2 ."')");
$result = sybase_fetch_array ($resource);When I change sql query to:
and execute this in sybase central - I've got my result set.CREATE VARIABLE VARIABLE par1;
CREATE VARIABLE VARIABLE par2;
SET par1 = 'something';
CALL proc2 (par1, par2);
SELECT par2 FROM DUMMY;
When I try execute last sql-query by php, I haven't got result set again.
So how I can execute stored procedure with input and output parameters and have got output parameters at result set?
Thank's for any ideas.
(sorry for bad English)