dscc90150010 2014-08-25 13:00
浏览 73

ZF2和Oracle存储过程调用具有不同的IN OUT参数长度

$parameterContainer = new \Zend\Db\Adapter\ParameterContainer();
$parameterContainer->offsetSet('paramName', $someString, $parameterContainer::TYPE_STRING);

where $someString is, for example, of length 30.

Now, this param is of "IN OUT" type, and in procedure it's being extended with some additional chars (input length: 30 but outputs 40).

Note: I do not even see this procedure code, but after many tests i see that it just appends chars to the initial string with no trimming etc...

Is simple with pure php (set length the to max possible output length) but in zf2's Zend\Db\Adapter\Driver\Oci8\Statement oci_bind_by_name() is being called always with -1 as length (so OUT length = IN length = length of initial string), which seems to make it impossible to use with that kind of procedure behavior (getting ORA-06502: PL/SQL: numeric or value error: character string buffer too small).

Or am I wrong and there IS any possibility (other that not using FW methods or overriding them) to achieve described goal?

Thanks in advance...

  • 写回答

1条回答 默认 最新

  • dtx9763 2015-04-22 23:19
    关注

    Rememeber that $someString is passed as reference so if you send a 30 lenght char you will get another 30 lenght char as maximum.

    I recommended you to increase the lenght.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题