PHP/OCI 插入期间出现无效字符

标签 php oracle oracle-call-interface

我尝试在 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 

最佳答案

$sql_update = "
update schema.table set last_check_dt = (select sysdate from dual)
where id = (select id from schema.email where current_email = '" . $email . "')";

您的 SQL,当通过 OCI 运行时......不需要 分号 作为终止符。

关于PHP/OCI 插入期间出现无效字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27137993/

相关文章:

javascript - AJAX - 没有得到简单的 php 响应(返回 "undefined")

sql - 我们可以在同一模式中创建具有相同名称的同义词吗

c# - 调用 Oracle 存储过程。获取 'No Data Found' 异常

我可以通过 OCI 函数获取 SID ("Oracle Session Id"吗?

php - 在 MAMP 中更改 openssl 版本

php - 错误 : Entities passed to the choice field must be managed

oracle - Oracle 中 ORDER BY 的 ORA-00904

c# - 使用 C# 中的 odp.net 和 OCI 连接到 Oracle

PHP/OCI - 无法从临时表中的 Oracle 过程中获取结果

PHP MySQL 项目计数查询