使用PHP的OCI_DEFAULT的Oracle oci_execute()的行为5.3.2 [英] Behavior of Oracle's oci_execute() using OCI_DEFAULT for PHP > 5.3.2
问题描述
我使用带有OCI_DEFAULT
标志的Oracle oci_execute()
遇到了一些旧代码.
I've come across some legacy code using Oracle's oci_execute()
with OCI_DEFAULT
flag.
oci_execute($this->result, OCI_DEFAULT);
但是,此服务器现在运行PHP> 5.3.2.根据OCI_DEFAULT
的 PHP文档:
However, this server now runs PHP > 5.3.2. According to the PHP Docs for OCI_DEFAULT
:
自PHP 5.3.2(PECL OCI8 1.4)起已作废,但仍可用于向后兼容.在新代码中使用等效的OCI_NO_AUTO_COMMIT.
Obsolete as of PHP 5.3.2 (PECL OCI8 1.4) but still available for backward compatibility. Use the equivalent OCI_NO_AUTO_COMMIT in new code.
所以我的问题分为两部分:
So my question is two part:
-
OCI_DEFAULT
对PHP<表示什么? 5.3.2? - 在PHP> = 5.3.2中使用
OCI_DEFAULT
时的有效模式是什么? (即上面的代码)
- What did
OCI_DEFAULT
represent for PHP < 5.3.2? - What is the effective mode when using
OCI_DEFAULT
in PHP >= 5.3.2? (i.e. the code above)
在尝试回答第2部分时,我希望找到oci_execute_mode()
进行调试.但是,AFAIK此类功能不存在.从运行脚本开始,它似乎在成功的PHP脚本结束(即,关闭连接时)上提交.
In attempts to answer part 2, I was hoping to find oci_execute_mode()
for debugging. However, AFAIK such functions do not exist. From running the script it appears it commits on successful PHP script end (i.e. when the connection is closed).
推荐答案
OCI_DEFAULT对PHP表示什么< 5.3.2?
What did OCI_DEFAULT represent for PHP < 5.3.2?
文档回答了您的第一个问题.
The docs answer your first question.
自PHP 5.3.2(PECL OCI8 1.4)起已作废,但仍可向后兼容.在新代码中使用等效的OCI_NO_AUTO_COMMIT.
Obsolete as of PHP 5.3.2 (PECL OCI8 1.4) but still available for backward compatibility. Use the equivalent OCI_NO_AUTO_COMMIT in new code.
然后,如果您寻找 OCI_NO_AUTO_COMMIT ...
Then if you look for OCI_NO_AUTO_COMMIT...
不自动提交更改.在PHP 5.3.2(PECL OCI8 1.4)之前,请使用OCI_DEFAULT,这是OCI_NO_AUTO_COMMIT的别名.
Do not automatically commit changes. Prior to PHP 5.3.2 (PECL OCI8 1.4) use OCI_DEFAULT which is an alias for OCI_NO_AUTO_COMMIT.
简短的回答:"OCI_DEFAULT< PHP 5.3.2" =与OCI_NO_AUTO_COMMIT> = PHP 5.3.2相同" =不要立即提交正在执行的语句."
Short answer: "OCI_DEFAULT < PHP 5.3.2" = "same as OCI_NO_AUTO_COMMIT >= PHP 5.3.2" = "Don't automatically commit the statement being executed right now."
在PHP> = 5.3.2中使用OCI_DEFAULT时的有效模式是什么? (即上面的代码)
What is the effective mode when using OCI_DEFAULT in PHP >= 5.3.2? (i.e. the code above)
它的作用与在<中所做的相同. 5.3.2保持向后兼容性-现在已过时/不推荐使用.您可以使用OCI_DEFAULT或OCI_NO_AUTO_COMMIT,但应使用后者,因为它可能不会永远存在.
It does the same thing as it did in < 5.3.2 to preserve backwards compatibility - it's just obsolete/deprecated now. You can use either OCI_DEFAULT or OCI_NO_AUTO_COMMIT, but you should use the latter because it may not be around forever.
这篇关于使用PHP的OCI_DEFAULT的Oracle oci_execute()的行为5.3.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!