0
我在執行此函數執行存儲過程時將數組作爲out參數。不能從存儲過程中使用php退出參數
function ExecuteProcedure($procedureName, $parameters)
{ $query = "begin " . $procedureName . "(" ;
for($i=0; $i<count($parameters); $i++)
{
if($i==0)
$query = $query . ":" . $parameters[$i][0] ;
else
$query = $query . ", :" . $parameters[$i][0] ;
}
$query = $query . "); end;";
//echo $query . "<br />";
$this->stmt = ociparse($this->con, $query) or die (ocierror());
for($i=0; $i<count($parameters); $i++)
{
$valueList = $parameters[$i];
if(count($valueList) == 2)
ocibindbyname($this->stmt, $valueList[0], $valueList[1]) or die (ocierror());
else if(count($valueList) == 3)
ocibindbyname($this->stmt, $valueList[0], $valueList[1], $valueList[2]) or die (ocierror());
else{
ocibindbyname($this->stmt, $valueList[0], $valueList[1], $valueList[2], $valueList[3]) or die (ocierror());
}
}
@ociexecute($this->stmt, OCI_DEFAULT) or die (ocierror());
return $parameters;
}
你做'返回$參數;'?你的'程序'應該做什麼? – SparKot
我的程序只在表格中插入值。我需要id作爲返回值,並且我已將id設置爲out_parameter作爲我的過程,但我沒有在此獲取id作爲outparameter – Urbi
您可以共享過程定義嗎? – SparKot