我有自定义类型的 SP:
Create Or Replace Type tyTestArrayType As Object
(siF1 SmallInt,
siF2 SmallInt,
siF3 SmallInt);
Create Or Replace Type tyTestArray Is Table Of tyTestArrayType;
Create Or Replace Procedure prTestArray(pArr tyTestArray,
pResult In Out SmallInt)
Is
Begin
pResult := 0;
For I In 1..pArr.Count
Loop
pResult := pResult + pArr(I).siF1 + pArr(I).siF2 + pArr(I).siF3;
End Loop;
End;
如何从 PHP (oci8) 使用这个过程(传递多维数组)?
谢谢,
更新:
这是在 Ruby 中执行此操作的代码:
plsql.connection = OCI8.new("user","pass","host/XE")
testArray = [{:sif1 => 1, :sif2 => 12, :sif3=>4},{:sif1 => 5, :sif2 => 2, :sif3=>3}]
puts plsql.prTestArray(p_testArray,0) #=> {:presult=>27}