マージを行おうとすると、このエラーが発生します。
PHP Warning: oci_execute(): ORA-01008: not all variables bound
クエリにあるすべての値がoci_bind_by_name()関数を使用してバインドされていること、およびデータが有効であることを確認しました。
これが私のコードです:
//Sample values just to test
$col1val = 'test1';
$col2val = 'test2';
$col3val = 'test3';
$col4val = 'test4';
$sql = "merge into tablespace.tb1 c using (select :col1val from dual) cd
on (c.col1 = cd.col1)
when not matched then
insert (c.col2, c.col1, c.col3, c.col4)
values (:col2val, :col1val, :col3val, :col4val)";
oci_bind_by_name($stid, ":col1val", $col1val);
oci_bind_by_name($stid, ":col2val", $col2val);
oci_bind_by_name($stid, ":col3val", $col3val);
oci_bind_by_name($stid, ":col4val", $col4val);
$stid = oci_parse($conn, $sql);
$result = oci_execute($stid);
oci_free_statement($stid);
PHP5とOracle10gを使用しています。
何か案は?