【发布时间】:2014-11-25 22:30:00
【问题描述】:
我正在尝试在 PHP 页面上执行 Oracle 插入语句,但出现以下错误。如果我从语句中删除分号,则页面永远不会加载(即使后端的插入需要几分之一秒)。任何提示将不胜感激!
$sql_update = "
update schema.table set last_check_dt = (select sysdate from dual)
where id = (select id from schema.email where current_email = '" . $email . "');";
$stid = oci_parse($conn, $sql_update);
oci_execute($stid);
oci_commit($conn);
oci_close($conn);
Warning: oci_execute() [function.oci-execute]: ORA-00911: invalid character
【问题讨论】:
-
要检查的三件事:分号没用但应该不是问题,您的 set 元素中的子查询很奇怪,是问题吗?此外,使用“id IN (SELECT....” 您的最后一个子查询会更好
-
@nek 子查询问题,我同意你的说法,但最终会出现不同的错误,而不是无效字符..
-
分号在这里看起来像一个错误的字符,这是对错误的最佳解释。 = 后面的 ( 更像是“token =”后面的解析错误。
标签: php oracle oracle-call-interface