diff --git a/reference/cubrid/constants.xml b/reference/cubrid/constants.xml
index 7a5db29099..6dee24b99d 100644
--- a/reference/cubrid/constants.xml
+++ b/reference/cubrid/constants.xml
@@ -5,8 +5,9 @@
&reftitle.constants;
&extension.constants;
- The following constants can be used when executing SQL statement. They can be passed to cubrid_prepare
- and cubrid_execute.
+ The following constants can be used when executing SQL statement. They can
+ be passed to cubrid_prepare and
+ cubrid_execute.
CUBRID SQL execution flags
@@ -25,14 +26,20 @@
CUBRID_ASYNC
Execute the query in asynchronous mode.
+
+ CUBRID_EXEC_QUERY_ALL
+ Execute the query in synchronous mode. This flag must be set
+ when executing multiple SQL statements.
+
- The following constants can be used when fetching the results to specify fetch behaviour. They can be passed to cubrid_fetch
- and cubrid_fetch_array.
+ The following constants can be used when fetching the results to specify
+ fetch behaviour. They can be passed to cubrid_fetch and
+ cubrid_fetch_array.
CUBRID fetch flags
@@ -65,7 +72,8 @@
- The following constants can be used when positioning the cursor in query results. They can be passed to or returned by
+ The following constants can be used when positioning the cursor in query
+ results. They can be passed to or returned by
cubrid_move_cursor.
CUBRID cursor position flags
@@ -107,7 +115,114 @@
- The following constants can be used when getting schema information. They can be passed to cubrid_schema.
+ The following constants can be used when setting the auto-commit mode for
+ the database connection. They can be passed to
+ cubrid_set_autocommit or returned by
+ cubrid_get_autocommit.
+
+ CUBRID auto-commit mode flags
+
+
+
+ Constant
+ Description
+
+
+
+
+ CUBRID_AUTOCOMMIT_TRUE
+ Enable the auto-commit mode.
+
+
+ CUBRID_AUTOCOMMIT_FALSE
+ Disable the auto-commit mode.
+
+
+
+
+
+
+
+ The following constants can be used when setting the database parameter.
+ They can be passed to cubrid_set_db_parameter.
+
+ CUBRID parameter flags
+
+
+
+ Constant
+ Description
+
+
+
+
+ CUBRID_PARAM_ISOLATION_LEVEL
+ Transaction isolation level for the database connection.
+
+
+ CUBRID_PARAM_LOCK_TIMEOUT
+ Transaction timeout in seconds.
+
+
+
+
+
+
+
+ The following constants can be used when setting the transaction isolation
+ level. They can be passed to cubrid_set_db_parameter
+ or returned by cubrid_get_db_parameter.
+
+ CUBRID isolation level flags
+
+
+
+ Constant
+ Description
+
+
+
+
+ TRAN_COMMIT_CLASS_UNCOMMIT_INSTANCE
+ The lowest isolation level (1). A dirty, non-repeatable or
+ phantom read may occur for the tuple and a non-repeatable read may
+ occur for the table as well.
+
+
+ TRAN_COMMIT_CLASS_COMMIT_INSTANCE
+ A relatively low isolation level (2). A dirty read does not
+ occur, but non-repeatable or phantom read may occur.
+
+
+ TRAN_REP_CLASS_UNCOMMIT_INSTANCE
+ The default isolation of CUBRID (3). A dirty, non-repeatable or
+ phantom read may occur for the tuple, but repeatable read is ensured
+ for the table.
+
+
+ TRAN_REP_CLASS_COMMIT_INSTANCE
+ A relatively low isolation level (4). A dirty read does not
+ occur, but non-repeatable or phantom read may.
+
+
+ TRAN_REP_CLASS_REP_INSTANCE
+ A relatively high isolation level (5). A dirty or non-repeatable
+ read does not occur, but a phantom read may.
+
+
+ TRAN_SERIALIZABLE
+ The highest isolation level (6). Problems concerning concurrency
+ (e.g. dirty read, non-repeatable read, phantom read, etc.) do not
+ occur.
+
+
+
+
+
+
+
+ The following constants can be used when getting schema information. They
+ can be passed to cubrid_schema.
CUBRID schema flags
diff --git a/reference/cubrid/functions/cubrid-bind.xml b/reference/cubrid/functions/cubrid-bind.xml
index f5e3381027..d75c53a0e6 100644
--- a/reference/cubrid/functions/cubrid-bind.xml
+++ b/reference/cubrid/functions/cubrid-bind.xml
@@ -12,20 +12,23 @@
boolcubrid_bind
resourcereq_identifier
- intbind_index
- stringbind_value
+ mixedbind_param
+ mixedbind_value
stringbind_value_type
- The cubrid_bind function is used to bind values in a
- cubrid_prepare variable, a various types in PHP and
- corresponding types in SQL. If bind_value_type is not given, string will
- be the default.
+ The cubrid_bind function is used to bind values to a
+ corresponding named or question mark placeholder in the SQL statement that
+ was passed to cubrid_prepare. If
+ bind_value_type is not given, string will be the
+ default.
- Known issue: If column data type is CLOB, binding parameter will fail.
- This bug will fixed later.
+ If the type of data to be bound is BLOB/CLOB, CUBRID will try to map the
+ data as a PHP stream. If the actually bind value type is not stream,
+ CUBRID will convert it to string, and use it as the full path and file
+ name of a file on the client filesystem.
@@ -139,15 +142,20 @@
cubrid_prepare.
- bind_index
- Index for binding.
+ bind_param
+ Parameter identifier. For a prepared statement using named
+ placeholders, this will be a parameter name of the form :name (Note that
+ the name can only contain digit, alphabet, and underscore, and it can not
+ begin with digit. The name length can not be longer than 32). For a prepared
+ statement using question mark placeholders, this will be the 1-indexed
+ position of the parameter.
bind_value
Actual value for binding.
- bind_index
+ bind_value_type
A type of the value to bind. (It is omitted by default.
Thus, system internally use string by default. However, you need to
specify the exact type of the value as an argument when they are NCHAR,
@@ -179,6 +187,13 @@
+
+ 8.4.0
+
+ Added named parameter support; When binding the LOB data type, it can
+ directly binding the path name of a file.
+
+
8.3.1
@@ -246,6 +261,53 @@ Barkley Charles
+
+ cubrid_bind named parameter example
+
+
+]]>
+
+&example.outputs;
+
+
+
+
+
cubrid_bind BLOB/CLOB example
@@ -258,7 +320,25 @@ if ($con) {
$fp = fopen("book.txt", "rb");
- cubrid_bind($req, 1, $fp, "blob");
+ cubrid_bind($req, 1, $fp, "clob");
+ cubrid_execute($req);
+}
+?>
+]]>
+
+
+
+
+ cubrid_bind BLOB/CLOB example
+
+
@@ -267,7 +347,7 @@ if ($con) {
-
+
&reftitle.seealso;
diff --git a/reference/cubrid/functions/cubrid-commit.xml b/reference/cubrid/functions/cubrid-commit.xml
index 319b5f1122..c8d7099544 100644
--- a/reference/cubrid/functions/cubrid-commit.xml
+++ b/reference/cubrid/functions/cubrid-commit.xml
@@ -11,7 +11,7 @@
&reftitle.description;
boolcubrid_commit
- resourceconn_identifier
+ resourceconn_identifier
The cubrid_commit function is used to execute commit
on the transaction pointed by conn_identifier,
@@ -21,9 +21,10 @@
In CUBRID PHP, an auto-commit mode is disabled by default for transaction
- management, and it can't be enabled in current version CUBRID PHP. It can
- be set in next version. And auto commit modes can be applied only for
- SELECT statements by setting broker parameters.
+ management, and you can set it by using
+ cubrid_set_autocommit, and get its status by using
+ cubrid_get_autocommit. Before you start a transaction,
+ remember to disable the auto-commit mode.
@@ -32,14 +33,14 @@
- conn_identifier
- Connection identifier.
+ conn_identifier
+ Connection identifier.
-
+
&reftitle.returnvalues;
&true;, when process is successful.
@@ -56,7 +57,7 @@
-
+
&reftitle.seealso;
cubrid_rollback
+ cubrid_get_autocommit
+ cubrid_set_autocommit
diff --git a/reference/cubrid/functions/cubrid-connect-with-url.xml b/reference/cubrid/functions/cubrid-connect-with-url.xml
index 93ec9531ed..592eb4d17c 100644
--- a/reference/cubrid/functions/cubrid-connect-with-url.xml
+++ b/reference/cubrid/functions/cubrid-connect-with-url.xml
@@ -16,20 +16,21 @@
stringpasswd
- The cubrid_connect_with_url function is used to
- establish the environment for connecting to your server by using
- connection information passed with an url string argument. If the HA
- feature is enabled in CUBRID, you must specify the connection information
- of the standby server, which is used for failover when failure occurs, in
- the url string argument of this function. If the user name and password is
- not given, then the "PUBLIC" connection will be made by default.
+ The cubrid_connect_with_url function is used to
+ establish the environment for connecting to your server by using connection
+ information passed with an url string argument. If the HA feature is
+ enabled in CUBRID, you must specify the connection information of the
+ standby server, which is used for failover when failure occurs, in the url
+ string argument of this function. If the user name and password is not
+ given, then the "PUBLIC" connection will be made by default.
- <url> ::= cci:CUBRID:<host>:<db_name>:<db_user>:<db_password>:[?<properties>]
- <properties> ::= <property> [&<propertygt;]
- <alternative_hosts> ::= <standby_broker1_host>:<port> [,<standby_broker2_host>:<port>]
- <host> := HOSTNAME | IP_ADDR
- <time> := SECOND
+ <url> ::= cci:CUBRID:<host>:<db_name>:<db_user>:<db_password>:[?<properties>]
+ <properties> ::= <property> [&<propertygt;]
+ <properties> ::= autocommit=<autocommit_mode>
+ <alternative_hosts> ::= <standby_broker1_host>:<port> [,<standby_broker2_host>:<port>]
+ <host> := HOSTNAME | IP_ADDR
+ <time> := SECOND
@@ -37,6 +38,7 @@
db_name : A name of the database
db_user : A name of the database user
db_password : A database user password
+ autocommit : The database connection auto-commit mode
alhosts: Specifies the broker information of the standby server, which is used for failover when it is impossible to connect to the active server. You can specify multiple brokers for failover, and the connection to the brokers is attempted in the order listed in alhosts
rctime : An interval between the attempts to connect to the active broker in which failure occurred. After a failure occurs, the system connects to the broker specified by althosts (failover), terminates the transaction, and then attempts to connect to the active broker of the master database at every rctime. The default value is 600 seconds.
@@ -80,12 +82,12 @@
-
diff --git a/reference/cubrid/functions/cubrid-execute.xml b/reference/cubrid/functions/cubrid-execute.xml
index 0aa4dcf593..cd021cf446 100644
--- a/reference/cubrid/functions/cubrid-execute.xml
+++ b/reference/cubrid/functions/cubrid-execute.xml
@@ -21,29 +21,50 @@
intoption
- The cubrid_execute function is used to execute
- the given SQL sentence. It executes the query by using
- conn_identifier and SQL, and then returns the
- request identifier created. It is used for simple execution of query,
- where the parameter binding is not needed. In addition, the
- cubrid_execute function is used to execute the
- prepared statement by means of cubrid_prepare and
- cubrid_bind. At this time, you need to specify
- arguments of request_identifier and
- option.
+ The cubrid_execute function is used to execute the
+ given SQL sentence. It executes the query by using
+ conn_identifier and SQL, and then returns the
+ request identifier created. It is used for simple execution of query,
+ where the parameter binding is not needed. In addition, the
+ cubrid_execute function is used to execute the
+ prepared statement by means of cubrid_prepare and
+ cubrid_bind. At this time, you need to specify
+ arguments of request_identifier and
+ option.
- You can use the option argument to tell whether
- to receive oid of the row after the execution, and, whether to execute
- the query in asynchronous mode. You can use it by setting the
- CUBRID_INCLUDE_OID and CUBRID_ASYNC using bitwise or operator. If the
- both variables are not explicitly given, they are not selected by
- default.
+ The option is used to determine whether to get OID
+ after query execution and whether to execute the query in synchronous or
+ asynchronous mode. CUBRID_INCLUDE_OID and CUBRID_ASYNC (or
+ CUBRID_EXEC_QUERY_ALL if you want to execute multiple SQL statements) can
+ be specified by using a bitwise OR operator. If not specified, neither of
+ them isselected. If the flag CUBRID_EXEC_QUERY_ALL is set, a synchronous
+ mode (sync_mode) is used to retrieve query results, and in such cases the
+ following rules are applied:
- If the first argument is request_identifier to
- execute the cubrid_prepare function, you can
- specify an option, CUBRID_ASYNC only.
+
+ The return value is the result of the first query.
+
+ If an error occurs in any query, the execution is processed as a
+ failure.
+
+
+ For a query composed of in a query composed of q1 q2 q3 if an error
+ occurs in q2 after q1 succeeds the execution, the result of q1 remains
+ valid. That is, the previous successful query executions are not rolled
+ back when an error occurs.
+
+
+ If a query is executed successfully, the result of the second query can
+ be obtained using cubrid_next_result().
+
+
+
+
+ If the first argument is request_identifier to
+ execute the cubrid_prepare function, you can specify
+ an option, CUBRID_ASYNC only.
@@ -61,7 +82,7 @@
option
- Query execution option CUBRID_INCLUDE_OID, CUBRID_ASYNC.
+ Query execution option CUBRID_INCLUDE_OID, CUBRID_ASYNC, CUBRID_EXEC_QUERY_ALL.
request_identifier
@@ -83,6 +104,30 @@
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ 8.4.0
+
+ Add new option CUBRID_EXEC_QUERY_ALL.
+
+
+
+
+
+
+
+
&reftitle.examples;
@@ -128,11 +173,12 @@ Phelps Michael 2004 51.25 time
&reftitle.seealso;
+ cubrid_prepare
+ cubrid_bind
+ cubrid_next_result
cubrid_close_request
cubrid_commit
cubrid_rollback
- cubrid_prepare
- cubrid_bind
diff --git a/reference/cubrid/functions/cubrid-get-autocommit.xml b/reference/cubrid/functions/cubrid-get-autocommit.xml
new file mode 100644
index 0000000000..5d81870d85
--- /dev/null
+++ b/reference/cubrid/functions/cubrid-get-autocommit.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+ cubrid_get_autocommit
+ Get auto-commit mode of the connection
+
+
+
+ &reftitle.description;
+
+ boolcubrid_get_autocommit
+ resourceconn_identifier
+
+
+ The cubrid_get_autocommit function is used to get the status of CUBRID
+ database connection auto-commit mode.
+
+
+ In CUBRID PHP, an auto-commit mode is disabled by default for transaction
+ management.
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ conn_identifier
+ Connection identifier.
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &true;, when process is successful.
+
+
+ &false;, when process is unsuccessful.
+
+
+
+
+ &reftitle.seealso;
+
+
+ cubrid_set_autocommit
+ cubrid_commit
+
+
+
+
+
+
diff --git a/reference/cubrid/functions/cubrid-get-db-parameter.xml b/reference/cubrid/functions/cubrid-get-db-parameter.xml
index f2364e2299..1a07205c68 100644
--- a/reference/cubrid/functions/cubrid-get-db-parameter.xml
+++ b/reference/cubrid/functions/cubrid-get-db-parameter.xml
@@ -20,10 +20,10 @@
- PARAM_ISOLATION_LEVEL
- LOCK_TIMEOUT
- MAX_STRING_LENGTH
- PARAM_AUTO_COMMIT
+ PARAM_ISOLATION_LEVEL
+ PARAM_LOCK_TIMEOUT
+ PARAM_MAX_STRING_LENGTH
+ PARAM_AUTO_COMMIT
@@ -39,35 +39,29 @@
PARAM_ISOLATION_LEVEL
- In current version CUBRID PHP, you can set the level of
- transaction isolation by using isolation_level in the
- $CUBRID/conf/cubrid.conf or the SET TRANSACTION statement. In next
- version, isolation level can be set using new CUBRID PHP API.
-
+ The transaction isolation level.
LOCK_TIMEOUT
CUBRID provides the lock timeout feature, which sets the waiting
- time for the lock until the transaction lock setting is allowed. The
- system parameter lock_timeout_in_secs in the $CUBRID/conf/cubrid.conf
- file or the SET TRANSACTION statement sets the timeout (in seconds).
- In next version, lock timeout can be set using new CUBRID PHP API.
- The default value of the lock_timeout_in_secs parameter is -1, which
- means the application client will wait indefinitely until the
- transaction lock is allowed.
+ time (in seconds) for the lock until the transaction lock setting is
+ allowed. The default value of the lock_timeout_in_secs parameter is
+ -1, which means the application client will wait indefinitely until
+ the transaction lock is allowed.
+
PARAM_AUTO_COMMIT
In CUBRID PHP, an auto-commit mode is disabled by default for
- transaction management, and it can't be enabled in current version
- CUBRID PHP. It can be set in next version. And auto commit modes can
- be applied only for SELECT statements by setting broker
- parameters.
+ transaction management. It can be set by using
+ cubrid_set_autocommit.
+
+
The following table shows the isolation levels from 1 to 6. It consists of
table schema (row) and isolation level:
@@ -158,6 +152,31 @@
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ 8.4.0
+
+ Change LOCK_TIMEOUT to PARAM_LOCK_TIMEOUT, and MAX_STRING_LENGTH to
+ PARAM_MAX_STRING_LENGTH in result.
+
+
+
+
+
+
+
+
&reftitle.examples;
@@ -206,8 +225,8 @@ cubrid_disconnect($conn);
CUBRID PHP Version: 8.3.1.0005
PARAM_ISOLATION_LEVEL 3
-LOCK_TIMEOUT -1
-MAX_STRING_LENGTH 1073741823
+PARAM_LOCK_TIMEOUT -1
+PARAM_MAX_STRING_LENGTH 1073741823
PARAM_AUTO_COMMIT 0
Server Info: 8.3.1.0173
@@ -218,6 +237,16 @@ CUBRID Charset: iso8859-1
+
+
+ &reftitle.seealso;
+
+
+ cubrid_set_db_parameter
+ cubrid_get_autocommit
+
+
+
+
+
+
+ cubrid_next_result
+ Get result of next query when executing multiple SQL statements
+
+
+
+ &reftitle.description;
+
+ boolcubrid_next_result
+ resourceresult
+
+
+ The cubrid_next_result function is used to get
+ results of next query if multiple SQL statements are executed and
+ CUBRID_EXEC_QUERY_ALL flag is set upon
+ cubrid_execute().
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ result
+ result comes from a call to cubrid_execute
+
+
+
+
+
+
+ &reftitle.returnvalues;
+ &true;, when process is successful.
+ &false;, when process is unsuccessful.
+
+
+
+ &reftitle.examples;
+
+ cubrid_next_result example
+
+
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ cubrid_execute
+
+
+
+
+
+
+
diff --git a/reference/cubrid/functions/cubrid-schema.xml b/reference/cubrid/functions/cubrid-schema.xml
index 370725d040..38ecf467ec 100644
--- a/reference/cubrid/functions/cubrid-schema.xml
+++ b/reference/cubrid/functions/cubrid-schema.xml
@@ -17,7 +17,12 @@
stringattr_name
- The cubrid_schema function is used to get the requested schema information from database. You have to designate class_name, if you want to get information on certain class, attr_name, if you want to get information on certain attribute (can be used only with CUBRID_ SCH_ATTR_PRIVILEGE).
+ The cubrid_schema function is used to get the
+ requested schema information from database. You have to designate
+ class_name, if you want to get information on
+ certain class, attr_name, if you want to get
+ information on certain attribute (can be used only with CUBRID_
+ SCH_ATTR_PRIVILEGE).
diff --git a/reference/cubrid/functions/cubrid-set-autocommit.xml b/reference/cubrid/functions/cubrid-set-autocommit.xml
new file mode 100644
index 0000000000..f0d3c01a61
--- /dev/null
+++ b/reference/cubrid/functions/cubrid-set-autocommit.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+ cubrid_set_autocommit
+ Set autocommit mode of the connection
+
+
+
+ &reftitle.description;
+
+ boolcubrid_set_autocommit
+ resourceconn_identifier
+ boolmode
+
+
+ The cubrid_set_autocommit function is used to set the
+ CUBRID database auto-commit mode of the current database connection.
+
+
+ In CUBRID PHP, an auto-commit mode is disabled by default for transaction
+ management. When auto-commit mode is truned from off to on, any pending work is
+ automatically committed.
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ conn_identifier
+ Connection identifier.
+
+
+ mode
+
+ Auto-commit mode. The following constants can be used:
+
+
+ CUBRID_AUTOCOMMIT_FALSE
+ CUBRID_AUTOCOMMIT_TRUE
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &true;, when process is successful.
+
+
+ &false;, when process is unsuccessful.
+
+
+
+
+ &reftitle.seealso;
+
+
+ cubrid_get_autocommit
+ cubrid_commit
+
+
+
+
+
+
diff --git a/reference/cubrid/functions/cubrid-set-db-parameter.xml b/reference/cubrid/functions/cubrid-set-db-parameter.xml
new file mode 100644
index 0000000000..fca249775f
--- /dev/null
+++ b/reference/cubrid/functions/cubrid-set-db-parameter.xml
@@ -0,0 +1,151 @@
+
+
+
+
+
+ cubrid_set_db_parameter
+ Sets the CUBRID database parameters
+
+
+
+ &reftitle.description;
+
+ boolcubrid_set_db_parameter
+ resourceconn_identifier
+ intparam_type
+ intparam_value
+
+
+ The cubrid_set_db_parameter function is used to set
+ the CUBRID database parameters. It can set the following CUBRID database
+ parameters:
+
+
+
+ PARAM_ISOLATION_LEVEL
+ PARAM_LOCK_TIMEOUT
+
+
+
+
+
+ The auto-commit mode can be set by using
+ cubrid_set_autocommit.
+
+
+
+
+
+ &reftitle.parameters;
+
+
+
+ conn_identifier
+
+ The CUBRID connection. If the connection identifier is not specified,
+ the last link opened by cubrid_connect is assumed.
+
+
+
+ param_type
+ Database parameter type.
+
+
+ param_value
+ Isolation level value (1-6) or lock timeout (in seconds) value.
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &true; on success.
+
+
+ &false; on failure.
+
+
+
+
+ &reftitle.examples;
+
+ cubrid_get_db_parameter example
+
+
+]]>
+
+ &example.outputs;
+
+
+ int(3)
+ ["PARAM_LOCK_TIMEOUT"]=>
+ int(-1)
+ ["PARAM_MAX_STRING_LENGTH"]=>
+ int(1073741823)
+ ["PARAM_AUTO_COMMIT"]=>
+ int(0)
+}
+array(4) {
+ ["PARAM_ISOLATION_LEVEL"]=>
+ int(2)
+ ["PARAM_LOCK_TIMEOUT"]=>
+ int(-1)
+ ["PARAM_MAX_STRING_LENGTH"]=>
+ int(1073741823)
+ ["PARAM_AUTO_COMMIT"]=>
+ int(1)
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+
+ cubrid_get_db_parameter
+ cubrid_set_autocommit
+
+
+
+
+
+
diff --git a/reference/cubrid/versions.xml b/reference/cubrid/versions.xml
index b154993b6e..05e2bba4b9 100644
--- a/reference/cubrid/versions.xml
+++ b/reference/cubrid/versions.xml
@@ -48,6 +48,7 @@
+
@@ -66,6 +67,7 @@
+
@@ -83,6 +85,8 @@
+
+