Hi good morning. I am trying to execute a stored procedure in oracle. The SP is as follows (
[b]Begin
- Call the procedure
Identity.sp_consultaserialcita (prmserial =>: prmserial,
Prmcur => prmcur);
End;[/b]
)
I’m trying to call it from my SiteController.php to do the first tests, but I can not get results.
My code:
[b]public function actionIndex()
{
$prmserial = 'C52923081161821';
$prmcur = " ";
//$sql = 'begin identidad.sp_consultaserialcita(prmserial => :prmserial,prmcur => :prmcur);end;';
$sql = 'call identidad.sp_consultaserialcita(:prmserial,:prmcur)';
$command = Yii::$app->db->createCommand($sql);
$command->bindParam(":prmserial",$prmserial,PDO::PARAM_INT);
$command->bindParam(":prmcur",$prmcur,PDO::CURSOR_FWDONLY);
$cursor = $command->execute();
print_r($cursor);
return $cursor;
}
[/b]
This throws me the following error:
[b]Database Exception - yii \ db \ Exception
Error Info: Array
(
[0] => HY000
[1] => 6553
[2] => OCIStmtExecute: ORA-06553: PLS-306: number or types of erroneous arguments when calling 'SP_CONSULTASERIALCITA'
(Ext.sup.core_statement.c: 148)
)
(I.e.
Caused by: PDOException[/b]