Ok, this sort of works.
I can certainly see the logic in it.
I had to add this line:
$recordset = OCINewCursor($c1);
But that's ok. It ran, and then said there was a problem with the compilation of the query, which was resolved by putting ' round the character variable in the stored procedure. This is also fine, but then it drops back to:
Warning: OCIStmtExecute: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'SP_ALERT_CHECK' ORA-06550: line 1, column 7: PL/SQL: Statement ignored
I know that the parameters passed to the Procedure are fine, because our DBA has checked them about 15 times (I think I'm annoying her - heh heh).
Any other ideas?
Full Code Listing Below
<?php
$c1 = ocilogon("xx","xx","slamon");
$updown = 'y';
$id = 1;
// ADDED A LINE HERE
$recordset = OCINewCursor($c1);
$stmt = OCIParse($c1,"BEGIN SP_ALERT_CHECK(:rec, $id, '$updown'); END;");
// Bind the record set, the -1 and OCI_B_CURSOR are required I don't know
// where idi you get the other stuff from.
OCIBindByName($stmt,":rec", &$recordset,-1,OCI_B_CURSOR);
//Execute the statment
OCIExecute($stmt);
//Execute your recordset, this step is also required
OCIExecute($recordset);
// now you can do ocifetchinto($recordset,$data) to get values from the record set
?>