I try to bind a list of variables by using a array as sth. like the follows:
$arr_var = Array();
$arr_var[] = Array("KEY"=>'rec_id', "VALUE"=>'000000', "LENGTH"=>-1);\
......
$stmt = OCIParse('DECLARE rec_id NUMBER(20); SELECT recNum INTO rec_id FROM
table WHERE recNum= 2 ');
......
$num_rows = count($arr_var);
for ($i=0; $i<$num_rows; $i++) {
if (is_array($arr_var[$i])) {
OCIBindByName($stmt, $arr_var[$i]['KEY'], $arr_var[$i]['VALUE'],
$arr_var[$i]['LENGTH']);
}
}
....
When it is executed, it get a warning: OCIBindByName: ORA-01036: illegal variable
name/number
Could anyone tell me what's wrong about this piece of code....
Is it impossible to bind a array? As I want to do it dynamically.......