Oci8Execption:参数数目或类型错误从PHP调用

问题描述

我在Oracle数据库上有一个过程,当我直接在其中使用它时,它运行良好,但是当我想使用OCI8驱动程序从PHP项目中使用它时,我会得到错误的数字或类型的参数错误。 / p>

该过程具有以下签名:

procedure_create_user(user_id in number,user_data in clob,result out boolean)

从PHP(Laravel代码库)中,我位于POST路由中,在其中提取主体(用户数据)并执行以下操作:

    $operationResult = false;

    $dbResult = executeProcedure($procedureName,[
              'user_id' => [
                 'value': 999999,'type': PDO::PARAM_INT,'length': 2048
              ],'user_data' => [
                 'value' => $requestBody,// the object (Parsed Body of the HTTP Request)
                 'type' => PDO::PARAM_LOB 
              ],'out' => [
                 'value' => &$operationResult,'type' => PDO::PARAM_BOOL
              ]
            ]);

我在网上看到一个建议,不要使用PARAM_LOB,而是使用PARAM_STR,所以我也这样做了: $ operationResult = false;

    $dbResult = executeProcedure($procedureName,'user_data' => [
                 'value' => json_encode($requestBody),'type' => PDO::PARAM_STR,'length' => strlen(json_encode($requestBody))
              ],'type' => PDO::PARAM_BOOL
              ]
            ]);

但是,两种方法最终都会引发完全相同的错误,Oci8Execption: Wrong number or types of arguments.

我也尝试过使用游标作为第三个参数,但是仍然抛出完全相同的错误。

有人知道为什么这里的参数或类型数量不匹配吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)