Menu

#299 [PHP] sql statment contained prepare can not execute using method cubrid_execute

open
nobody
None
5
2012-09-28
2012-09-28
Jira Trac
No

[PHP] sql statment contained prepare can not execute using method cubrid_execute.

Test verion:
{noformat}
Cubrid: CUBRID 9.0 (9.0.0.0455)
PHP Driver:
http://svn.cubrid.org/cubridapis/php/branches/RB-9.0.0 Revision: 867
{noformat}

Test codes:
{noformat}
//prepare
$sql = prepare x from 'update enum032 set e3=? where id=1';
$req = cubrid_prepare($conn, $sql, CUBRID_INCLUDE_OID);
cubrid_execute($req);
if (!$req) {
printf([001] [%d] %s\n, cubrid_errno($conn), cubrid_error($conn));
}

//execute
$sql = execute x using -1;
$req = cubrid_prepare($conn, $sql, CUBRID_INCLUDE_OID);
cubrid_execute($req);
if (!$req) {
printf([001] [%d] %s\n, cubrid_errno($conn), cubrid_error($conn));
}
{noformat}

Test result:
{noformat}
Warning: Error: DBMS, -995, A prepared statement with the name x does not exist. in /home/php/phptestcases/php/php/_18_enum/enum_prepare_01.php on line 43

Warning: cubrid_execute() expects parameter 1 to be resource, boolean given in /home/php/phptestcases/php/php/_18_enum/enum_prepare_01.php on line 44
[001] [-995] A prepared statement with the name x does not exist.
{noformat}

These two sql statment can execute in csql :
{noformat}
csql prepare x from 'update enum032 set e3=? where id=1';

Current transaction has been committed.

1 command(s) successfully processed.
csql execute x using -1;

In the command from line 1,

ERROR: Cannot coerce value of domain integer to domain enum.

0 command(s) successfully processed.
csql
{noformat}

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.