From b2da15136d4030db26992d17cfcb59ecc35cd3ce Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 6 Sep 2005 20:18:30 +0000 Subject: [PATCH] updated OCI8 docs git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@195287 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/oci8/configure.xml | 5 +- reference/oci8/constants.xml | 68 +++- .../oci8/functions/OCI-Collection-append.xml | 72 +++- .../oci8/functions/OCI-Collection-assign.xml | 74 ++-- .../functions/OCI-Collection-assignElem.xml | 80 ++-- .../oci8/functions/OCI-Collection-free.xml | 55 ++- .../oci8/functions/OCI-Collection-getElem.xml | 81 ++-- .../oci8/functions/OCI-Collection-max.xml | 55 +-- .../oci8/functions/OCI-Collection-size.xml | 51 ++- .../oci8/functions/OCI-Collection-trim.xml | 74 ++-- reference/oci8/functions/OCI-Lob-append.xml | 88 +++-- reference/oci8/functions/OCI-Lob-close.xml | 69 ++-- reference/oci8/functions/OCI-Lob-eof.xml | 54 ++- reference/oci8/functions/OCI-Lob-erase.xml | 94 +++-- reference/oci8/functions/OCI-Lob-export.xml | 96 +++-- reference/oci8/functions/OCI-Lob-flush.xml | 92 +++-- reference/oci8/functions/OCI-Lob-free.xml | 47 ++- .../oci8/functions/OCI-Lob-getBuffering.xml | 53 ++- reference/oci8/functions/OCI-Lob-import.xml | 80 ++-- reference/oci8/functions/OCI-Lob-load.xml | 64 +-- reference/oci8/functions/OCI-Lob-read.xml | 84 ++-- reference/oci8/functions/OCI-Lob-rewind.xml | 60 +-- reference/oci8/functions/OCI-Lob-save.xml | 97 +++-- reference/oci8/functions/OCI-Lob-seek.xml | 117 ++++-- .../oci8/functions/OCI-Lob-setBuffering.xml | 94 +++-- reference/oci8/functions/OCI-Lob-size.xml | 41 +- reference/oci8/functions/OCI-Lob-tell.xml | 57 +-- reference/oci8/functions/OCI-Lob-truncate.xml | 79 ++-- reference/oci8/functions/OCI-Lob-write.xml | 92 +++-- .../oci8/functions/OCI-Lob-writeTemporary.xml | 120 +++--- reference/oci8/functions/oci-bind-by-name.xml | 5 +- reference/oci8/functions/oci-cancel.xml | 2 +- reference/oci8/functions/oci-close.xml | 14 +- reference/oci8/functions/oci-commit.xml | 10 +- reference/oci8/functions/oci-connect.xml | 55 ++- .../oci8/functions/oci-define-by-name.xml | 9 +- reference/oci8/functions/oci-error.xml | 2 +- reference/oci8/functions/oci-execute.xml | 9 +- reference/oci8/functions/oci-fetch-all.xml | 5 +- reference/oci8/functions/oci-fetch-array.xml | 12 +- reference/oci8/functions/oci-fetch-assoc.xml | 10 +- reference/oci8/functions/oci-fetch-object.xml | 8 +- reference/oci8/functions/oci-fetch-row.xml | 5 +- reference/oci8/functions/oci-field-name.xml | 2 +- .../oci8/functions/oci-field-precision.xml | 2 +- reference/oci8/functions/oci-field-scale.xml | 2 +- reference/oci8/functions/oci-field-size.xml | 2 +- .../oci8/functions/oci-field-type-raw.xml | 2 +- reference/oci8/functions/oci-field-type.xml | 2 +- .../oci8/functions/oci-internal-debug.xml | 2 +- reference/oci8/functions/oci-lob-copy.xml | 12 +- .../oci8/functions/oci-new-collection.xml | 9 +- reference/oci8/functions/oci-new-connect.xml | 44 ++- reference/oci8/functions/oci-new-cursor.xml | 2 +- .../oci8/functions/oci-new-descriptor.xml | 2 +- reference/oci8/functions/oci-num-rows.xml | 2 +- reference/oci8/functions/oci-parse.xml | 2 +- .../oci8/functions/oci-password-change.xml | 15 +- reference/oci8/functions/oci-pconnect.xml | 59 ++- reference/oci8/functions/oci-rollback.xml | 10 +- .../oci8/functions/oci-server-version.xml | 2 +- reference/oci8/functions/oci-set-prefetch.xml | 7 +- .../oci8/functions/oci-statement-type.xml | 2 +- reference/oci8/functions/ocibindbyname.xml | 140 +------ reference/oci8/functions/ocicancel.xml | 48 +-- reference/oci8/functions/ocicloselob.xml | 44 +-- reference/oci8/functions/ocicollappend.xml | 44 +-- reference/oci8/functions/ocicollassign.xml | 44 +-- .../oci8/functions/ocicollassignelem.xml | 45 +-- reference/oci8/functions/ocicollgetelem.xml | 44 +-- reference/oci8/functions/ocicollmax.xml | 44 +-- reference/oci8/functions/ocicollsize.xml | 44 +-- reference/oci8/functions/ocicolltrim.xml | 44 +-- reference/oci8/functions/ocicolumnisnull.xml | 52 +-- reference/oci8/functions/ocicolumnname.xml | 83 +--- .../oci8/functions/ocicolumnprecision.xml | 54 +-- reference/oci8/functions/ocicolumnscale.xml | 45 +-- reference/oci8/functions/ocicolumnsize.xml | 85 +--- reference/oci8/functions/ocicolumntype.xml | 84 +--- reference/oci8/functions/ocicolumntyperaw.xml | 49 +-- reference/oci8/functions/ocicommit.xml | 84 +--- reference/oci8/functions/ocidefinebyname.xml | 93 +---- reference/oci8/functions/ocierror.xml | 62 +-- reference/oci8/functions/ociexecute.xml | 56 +-- reference/oci8/functions/ocifetch.xml | 48 +-- reference/oci8/functions/ocifetchinto.xml | 2 +- .../oci8/functions/ocifetchstatement.xml | 54 +-- .../oci8/functions/ocifreecollection.xml | 44 +-- reference/oci8/functions/ocifreecursor.xml | 50 +-- reference/oci8/functions/ocifreedesc.xml | 48 +-- reference/oci8/functions/ocifreestatement.xml | 50 +-- reference/oci8/functions/ociinternaldebug.xml | 51 +-- reference/oci8/functions/ociloadlob.xml | 44 +-- reference/oci8/functions/ocilogoff.xml | 55 +-- reference/oci8/functions/ocilogon.xml | 159 +------- reference/oci8/functions/ocinewcollection.xml | 46 +-- reference/oci8/functions/ocinewcursor.xml | 120 +----- reference/oci8/functions/ocinewdescriptor.xml | 166 +------- reference/oci8/functions/ocinlogon.xml | 163 +------- reference/oci8/functions/ocinumcols.xml | 78 +--- reference/oci8/functions/ociparse.xml | 53 +-- reference/oci8/functions/ociplogon.xml | 60 +-- reference/oci8/functions/ociresult.xml | 56 +-- reference/oci8/functions/ocirollback.xml | 49 +-- reference/oci8/functions/ocirowcount.xml | 76 +--- reference/oci8/functions/ocisavelob.xml | 44 +-- reference/oci8/functions/ocisavelobfile.xml | 44 +-- reference/oci8/functions/ociserverversion.xml | 59 +-- reference/oci8/functions/ocisetprefetch.xml | 49 +-- reference/oci8/functions/ocistatementtype.xml | 79 +--- .../oci8/functions/ociwritelobtofile.xml | 46 +-- .../oci8/functions/ociwritetemporarylob.xml | 45 +-- reference/oci8/ini.xml | 210 ++++++++++ reference/oci8/reference.xml | 372 +++++++++++++++--- 114 files changed, 2904 insertions(+), 3325 deletions(-) create mode 100644 reference/oci8/ini.xml diff --git a/reference/oci8/configure.xml b/reference/oci8/configure.xml index 92ee9ab622..2ba51d9a75 100644 --- a/reference/oci8/configure.xml +++ b/reference/oci8/configure.xml @@ -1,5 +1,5 @@ - +
&reftitle.install; @@ -8,7 +8,8 @@ your environment variable ORACLE_HOME. - If you're using Oracle Instant Client, you need to build PHP with the option + If you're using Oracle Instant + Client, you need to build PHP with the option . Note that Oracle Instant Client support first appeared in versions 4.3.11 and 5.0.4. diff --git a/reference/oci8/constants.xml b/reference/oci8/constants.xml index 18d2ed0254..32560595d4 100644 --- a/reference/oci8/constants.xml +++ b/reference/oci8/constants.xml @@ -1,5 +1,5 @@ - +
&reftitle.constants; &extension.constants; @@ -24,7 +24,7 @@ Statement execution mode. Use this mode if you don't want - to really execute query, but only get select-list description. + to execute the query, but get the select-list's description. @@ -383,6 +383,69 @@ + + + OCI_SYSOPER + (integer) + + + + Used with oci_connect to connect as SYSOPER + using external credentials (oci8.privileged_connect + should be enabled for this). + + + + + + OCI_SYSDBA + (integer) + + + + Used with oci_connect to connect as SYSDBA + using external credentials (oci8.privileged_connect + should be enabled for this). + + + + + + OCI_LOB_BUFFER_FREE + (integer) + + + + Used with to free buffers used. + + + + + + OCI_TEMP_CLOB + (integer) + + + + Used with to indicate + explicilty that temporary CLOB should be created. + + + + + + OCI_TEMP_BLOB + (integer) + + + + Used with to indicate + explicilty that temporary BLOB should be created. + + +
@@ -406,3 +469,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/OCI-Collection-append.xml b/reference/oci8/functions/OCI-Collection-append.xml index 58b11c5838..baf8cada17 100644 --- a/reference/oci8/functions/OCI-Collection-append.xml +++ b/reference/oci8/functions/OCI-Collection-append.xml @@ -1,25 +1,55 @@ - - - - OCI-Collection->append - Appends an object to the collection - - - Description - - boolOCI-Collection->append - mixedvalue - - - Appends an object to the end of the collection. Parameter - value can be a string or a number. - - - &return.success; - - - + + + + OCI-Collection->append + Appends element to the collection + + + + &reftitle.description; + + OCI-Collection + + boolappend + mixedvalue + + + + Appends element to the end of the collection. Parameter + value can be a string or a number. + + + &return.success; + + + + + &reftitle.parameters; + + + + value + + + The value to be added to the collection. + + + + + + + + + &reftitle.seealso; + + + + + + + + - - - OCI-Collection->assign - Assigns a value to the collection from another existing collection - - - Description - - boolOCI-Collection->assign - OCI-Collectionfrom - - - Assigns a value to the collection from another, previously created - collection. Both collections must be created with - oci_new_collection prior to using them. - - - &return.success; - - - + + + + OCI-Collection->assign + Assigns a value to the collection from another existing collection + + + + &reftitle.description; + + OCI-Collection + + boolassign + OCI-Collectionfrom + + + + Assigns a value to the collection from another, previously created + collection. Both collections must be created with + oci_new_collection prior to using them. + + + &return.success; + + + + + &reftitle.parameters; + + + + from + + + An instance of OCI-Collection. + + + + + + + + + &reftitle.seealso; + + + + + + + + - - - OCI-Collection->assignElem - Assigns a value to the element of the collection - - - Description - - boolOCI-Collection->assignElem - intindex - mixedvalue - - - Assigns a value to the element with index index. - Parameter value can be a string or a number. - - - &return.success; - - - + + + + OCI-Collection->assignElem + Assigns a value to the element of the collection + + + + &reftitle.description; + + OCI-Collection + + boolassignElem + intindex + mixedvalue + + + + Assigns a value to the element with index index. + Parameter value can be a string or a number. + + + &return.success; + + + + + &reftitle.parameters; + + + + index + + + + + + + value + + + + + + + + + + + &reftitle.seealso; + + + + + + + + - - - OCI-Collection->free - Frees resources associated with collection object - - - Description - - boolOCI-Collection->free - - - - Frees resources associated with collection object. - - - &return.success; - - - + + + + OCI-Collection->free + Frees the resources associated with the collection object + + + + &reftitle.description; + + OCI-Collection + + boolfree + + + + + Frees the resources associated with the collection object. + + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + diff --git a/reference/oci8/functions/OCI-Collection-getElem.xml b/reference/oci8/functions/OCI-Collection-getElem.xml index 071b5ae64c..a22cb6643d 100644 --- a/reference/oci8/functions/OCI-Collection-getElem.xml +++ b/reference/oci8/functions/OCI-Collection-getElem.xml @@ -1,32 +1,56 @@ - - - - OCI-Collection->getElem - Returns value of the element - - - Description - - mixedOCI-Collection->getElem - intindex - - - Method OCI-Collection->getElem returns value of the - element with index index (1-based). - - - OCI-Collection->getElem will return &false; if - such element doesn't exist; &null; if element is &null;; string if - element is column of a string datatype or number if element is numeric - field. - - - OCI-Collection->getElem will return &false; in case of - error. - - - + + + + OCI-Collection->getElem + Returns value of the element + + + + &reftitle.description; + + OCI-Collection + + mixedgetElem + intindex + + + + Returns element's value with the index index (1-based). + + + OCI-Collection->getElem returns &false; if + such element doesn't exist; &null; if element is &null;; string if + element is column of a string datatype or number if element is numeric + field. + + + + + &reftitle.parameters; + + + + index + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + diff --git a/reference/oci8/functions/OCI-Collection-max.xml b/reference/oci8/functions/OCI-Collection-max.xml index f2cf64f7aa..023c7dcb36 100644 --- a/reference/oci8/functions/OCI-Collection-max.xml +++ b/reference/oci8/functions/OCI-Collection-max.xml @@ -1,26 +1,37 @@ - - - - OCI-Collection->max - Gets the maximum number of elements in the collection - - - Description - - intOCI-Collection->max - - - - Returns the maximum number of elements in the collection. - If the returned value is 0, then the number of elements is not limited. - OCI-Collection->max returns &false; in case of error. - - - See also oci_collection_size. - - - + + + + OCI-Collection->max + Returns the maximum number of elements in the collection + + + + &reftitle.description; + + OCI-Collection + + intmax + + + + + Returns the maximum number of elements in the collection. + If the returned value is 0, then the number of elements is not limited. + OCI-Collection->max returns &false; in case of error. + + + + + &reftitle.seealso; + + + + + + + + - - - OCI-Collection->size - Returns size of the collection - - - Description - - intOCI-Collection->size - - - - Returns the number of elements in the collection. - - - See also oci_collection_max. - - - + + + + OCI-Collection->size + Returns size of the collection + + + + &reftitle.description; + + OCI-Collection + + intsize + + + + + Returns the number of elements in the collection or &false; on error. + + + + + &reftitle.seealso; + + + + + + + + - - - OCI-Collection->trim - Trims elements from the end of the collection - - - Description - - boolOCI-Collection->trim - intnum - - - Trims num of elements from the end of the - collection. - - - &return.success; - - - See also oci_collection_size. - - - + + + + OCI-Collection->trim + Trims elements from the end of the collection + + + + &reftitle.description; + + OCI-Collection + + booltrim + intnum + + + + Trims num of elements from the end of the + collection. + + + &return.success; + + + + + &reftitle.parameters; + + + + num + + + + + + + + + + + &reftitle.seealso; + + + + + + + + - - - lob->append - Appends data from the large object to another large object - - - Description - - boollob->append - OCI-Loblob_from - - - Appends data from the large object to the end of another large object. - - - Writing to the large object with lob->append will - fail if buffering was previously enabled. You must disable buffering - before appending. You may need to flush buffers with - oci_lob_flush before disabling buffering. - - - &return.success; - - - See also oci_lob_flush, - ocisetbufferinglob and - ocigetbufferinglob. - - - + + + + OCI-Lob->append + Appends data from the large object to another large object + + + + &reftitle.description; + + OCI-Lob + + boolappend + OCI-Loblob_from + + + + Appends data from the large object to the end of another large object. + + + Writing to the large object with OCI-Lob->append will + fail if buffering was previously enabled. You must disable buffering + before appending. You may need to flush buffers with + before disabling buffering. + + + &return.success; + + + + + &reftitle.parameters; + + + + lob_from + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + + - - - lob->close - Closes LOB descriptor - - - Description - - boollob->close - - - - lob->close closes descriptor of LOB or FILE. This - function should be used only with - lob->writeTemporary. - - - &return.success; - - - - In PHP versions before 5.0.0 you must use ocicloselob instead. - This name still can be used, it was left as alias of - oci_lob_close for downwards compatability. - This, however, is deprecated and not recommended. - - - - See also oci_lob_write_temporary. - - - + + + + OCI-Lob->close + Closes LOB descriptor + + + + &reftitle.description; + + OCI-Lob + + boolclose + + + + + OCI-Lob->close closes descriptor of LOB or FILE. This + function should be used only with + . + + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + - - - lob->eof - Tests for end-of-file on a large object's descriptor - - - Description - - boollob->eof - - - - Returns &true; if internal pointer of large object is at the end of LOB. - Otherwise returns &false;. - - - See also oci_lob_size. - - - + + + + OCI-Lob->eof + Tests for end-of-file on a large object's descriptor< + + + + &reftitle.description; + + OCI-Lob + + booleof + + + + + Returns &true; if internal pointer of large object is at the end of LOB. + Otherwise returns &false;. + + + + + &reftitle.seealso; + + + + + + + + + - - - lob->erase - Erases a specified portion of the internal LOB data - - - Description - - intlob->erase - intoffset - intlength - - - Erases a specified portion of the internal LOB data starting at a - specified offset. Parameters - length and offset are optional. - lob->erase erases all LOB data by default. - - - For BLOBs, erasing means that the existing LOB value is overwritten with - zero-bytes. For CLOBs, the existing LOB value is overwritten with spaces. - - - lob->erase returns the actual number of - characters/bytes erased or &false; in case of error. - - - + + + + OCI-Lob->erase + Erases a specified portion of the internal LOB data + + + + &reftitle.description; + + OCI-Lob + + interase + intoffset + intlength + + + + Erases a specified portion of the internal LOB data starting at a + specified offset. Parameters + length and offset are optional. + OCI-Lob->erase erases all LOB data by default. + + + For BLOBs, erasing means that the existing LOB value is overwritten with + zero-bytes. For CLOBs, the existing LOB value is overwritten with spaces. + + + OCI-Lob->erase returns the actual number of + characters/bytes erased or &false; in case of error. + + + + + &reftitle.parameters; + + + + offset + + + + + + + length + + + + + + + + + + + &reftitle.seealso; + + + + + + + + - - - lob->export - Exports LOB's contents to a file - - - Description - - boollob->export - stringfilename - intstart - intlength - - - Exports LOB's contents to a file, which name is given in parameter - filename. Optional parameter - start indicates from what position to start export - and parameter length - length of data to be - exported. - - - &return.success; - - - + + + + OCI-Lob->export + Exports LOB's contents to a file + + + + &reftitle.description; + + OCI-Lob + + boolexport + stringfilename + intstart + intlength + + + + Exports LOB contents to a file. The file name is given in the parameter + filename. The optional parameter + start indicates from where to start exporting + and the parameter length - indicates the length of data to be + exported. + + + &return.success; + + + + + &reftitle.parameters; + + + + filename + + + + + + + start + + + + + + + length + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + diff --git a/reference/oci8/functions/OCI-Lob-flush.xml b/reference/oci8/functions/OCI-Lob-flush.xml index 6659ddbdd2..9e17a763d2 100644 --- a/reference/oci8/functions/OCI-Lob-flush.xml +++ b/reference/oci8/functions/OCI-Lob-flush.xml @@ -1,35 +1,65 @@ - - - - lob->flush - Flushes/writes buffer of the LOB to the server - - - Description - - boollob->flush - intflag - - - lob->flush actually writes data to the server. - By default, resources are not freed, but using flag - OCI_LOB_BUFFER_FREE you can do it explicitly. - Be sure you know what you're doing - next read/write operation to the - same part of LOB will involve a round-trip to the server and initialize - new buffer resources. It is recommended to use - OCI_LOB_BUFFER_FREE flag only when you are not going - to work with the LOB anymore. - - - lob->flush returns &false; if buffering was not - enabled or an error occurred. - - - &return.success; - - - + + + + OCI-Lob->flush + Flushes/writes buffer of the LOB to the server + + + + &reftitle.description; + + OCI-Lob + + boolflush + intflag + + + + OCI-Lob->flush actually writes data to the server. + By default, resources are not freed, but using flag + OCI_LOB_BUFFER_FREE you can do it explicitly. + Be sure you know what you're doing - next read/write operation to the + same part of LOB will involve a round-trip to the server and initialize + new buffer resources. It is recommended to use + OCI_LOB_BUFFER_FREE flag only when you are not going + to work with the LOB anymore. + + + OCI-Lob->flush returns &false; if buffering was not + enabled or an error occurred. + + + &return.success; + + + + + &reftitle.parameters; + + + + flag + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + - - - descriptor->free - Frees resources associated with descriptor - - - Description - - booldescriptor->free - - - - descriptor->free frees resources associated with - descriptor, previously allocated with oci_new_descriptor. - - - &return.success; - - - + + + + OCI-Lob->free + Frees resources associated with the LOB descriptor + + + + &reftitle.description; + + OCI-Lob + + boolfree + + + + + Frees resources associated with the descriptor, previously allocated with + oci_new_descriptor. + + + &return.success; + + + + - - - lob->getBuffering - Returns current state of buffering for large object - - - Description - - boollob->getBuffering - - - - Returns &false; if buffering for the large object is off and &true; if - buffering is used. - - - See also ocisetbufferinglob. - - - + + + + OCI-Lob->getBuffering + Returns current state of buffering for the large object + + + + &reftitle.description; + + OCI-Lob + + boolgetBuffering + + + + + Returns &false; if buffering for the large object is off and &true; if + buffering is used. + + + + + &reftitle.seealso; + + + + + + + + - - - lob->import - Imports file data to the LOB - - - Description - - boollob->import - stringfilename - - - Writes data from filename in to the current - position of large object. - - - &return.success; - - - - In PHP versions before 5.0.0 you must use ocisavelobfile instead. - This name still can be used, it was left as alias of - oci_lob_import for downwards compatability. - This, however, is deprecated and not recommended. - - - - + + + + OCI-Lob->import + Imports file data to the LOB + + + + &reftitle.description; + + OCI-Lob + + boolimport + stringfilename + + + + Writes data from the filename in to the current + position of large object. + + + &return.success; + + + + + &reftitle.parameters; + + + + filename + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + - - - lob->load - Returns large object's contents - - - Description - - stringlob->load - - - - Returns large object's contents. As script execution is terminated - when the memory_limit is reached, - ensure that the LOB does not exceed this limit. In most cases it's - recommended to use oci_lob_read instead. In case of - error lob->load returns &false;. - - - - In PHP versions before 5.0.0 you must use ociloadlob instead. - This name still can be used, it was left as alias of - oci_lob_load for downwards compatability. - This, however, is deprecated and not recommended. - - - - + + + + OCI-Lob->load + Returns large object's contents + + + + &reftitle.description; + + OCI-Lob + + stringload + + + + + Returns large object's contents. As script execution is terminated + when the memory_limit is reached, + ensure that the LOB does not exceed this limit. In most cases it's + recommended to use instead. + In case of error OCI-Lob->load returns &false;. + + + + + &reftitle.seealso; + + + + + + + + - - - lob->read - Reads part of large object - - - Description - - stringlob->read - intlength - - - Reads length bytes from the current position of - LOB's internal pointer. Reading stops when length - bytes have been read or end of large object is reached. - Internal pointer of large object will be shifted on the amount of bytes - read. - - - Returns &false; in case of error. - - - See also oci_lob_eof, - oci_lob_seek, - oci_lob_tell and - oci_lob_write. - - - + + + + OCI-Lob->read + Reads part of the large object + + + + &reftitle.description; + + OCI-Lob + + stringread + intlength + + + + Reads length bytes from the current position of LOB's internal pointer. + Reading stops when length bytes have been read or + end of the large object is reached. Internal pointer of the large object will + be shifted on the amount of bytes read. + + + Returns &false; in case of error. + + + + + &reftitle.parameters; + + + + length + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + + diff --git a/reference/oci8/functions/OCI-Lob-rewind.xml b/reference/oci8/functions/OCI-Lob-rewind.xml index 554450c0b0..44fcde8a3b 100644 --- a/reference/oci8/functions/OCI-Lob-rewind.xml +++ b/reference/oci8/functions/OCI-Lob-rewind.xml @@ -1,28 +1,40 @@ - - - - lob->rewind - Moves the internal pointer to the beginning of the large object - - - Description - - boollob->rewind - - - - Sets the internal pointer to the beginning of the large object. - - - &return.success; - - - See also oci_lob_seek and - oci_lob_tell. - - - + + + + OCI-Lob->rewind + Moves the internal pointer to the beginning of the large object + + + + &reftitle.description; + + OCI-Lob + + boolrewind + + + + + Sets the internal pointer to the beginning of the large object. + + + &return.success; + + + + + &reftitle.seealso; + + + + + + + + + + - - - lob->save - Saves data to the large object - - - Description - - boollob->save - stringdata - intoffset - - - Saves data to the large object. - Parameter offset can be used to indicate offset - from the beginning of the large object. - - - &return.success; - - - - In PHP versions before 5.0.0 you must use ocisavelob instead. - This name still can be used, it was left as alias of - oci_lob_save for downwards compatability. - This, however, is deprecated and not recommended. - - - - See also oci_lob_write and - oci_lob_import. - - - + + + + OCI-Lob->save + Saves data to the large object + + + + &reftitle.description; + + OCI-Lob + + boolsave + stringdata + intoffset + + + + Saves data to the large object. + Parameter offset can be used to indicate offset + from the beginning of the large object. + + + &return.success; + + + + + &reftitle.parameters; + + + + data + + + + + + + + + offset + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + - - - lob->seek - Sets the internal pointer of the large object - - - Description - - boollob->seek - intoffset - intwhence - - - Sets the internal pointer of the large object. Parameter - offset indicates the amount of - bytes, on which internal pointer should be moved from the position, - pointed by whence: - - - OCI_SEEK_SET - sets the position equal to - offset - - - OCI_SEEK_CUR - adds offset - bytes to the current position - - - OCI_SEEK_END - adds offset - bytes to the end of large object (use negative value to move to a position - before the end of large object) - - - - - See also oci_lob_rewind and - oci_lob_tell. - - - + + + + OCI-Lob->seek + Sets the internal pointer of the large object + + + + &reftitle.description; + + OCI-Lob + + boolseek + intoffset + intwhence + + + + Sets the internal pointer of the large object. Parameter + offset indicates the amount of + bytes, on which internal pointer should be moved from the position, + pointed by whence: + + + OCI_SEEK_SET - sets the position equal to + offset + + + OCI_SEEK_CUR - adds offset + bytes to the current position + + + OCI_SEEK_END - adds offset + bytes to the end of large object (use negative value to move to a position + before the end of large object) + + + + + &return.success; + + + + + &reftitle.parameters; + + + + offset + + + + + + + whence + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + + - - - lob->setBuffering - Changes current state of buffering for large object - - - Description - - boollob->setBuffering - boolon_off - - - lob->setBuffering sets the buffering for the - large object, depending on the value of the on_off - parameter. Repeated calls to lob->setBuffering with - the same flag will return &true;. The values for on_off - are: &true; for on and &false; for off. - - - Use of this function may provide performance improvements by buffering - small reads and writes of LOBs by reducing the number of network - round-trips and LOB versions. oci_lob_flush should - be used to flush buffers, when you have finished working with the large - object. - - - &return.success; - - - See also ocigetbufferinglob. - - - + + + + OCI-Lob->setBuffering + Changes current state of buffering for the large object + + + + &reftitle.description; + + OCI-Lob + + boolsetBuffering + boolon_off + + + + lob->setBuffering sets the buffering for the + large object, depending on the value of the on_off + parameter. Repeated calls to lob->setBuffering with + the same flag will return &true;. The values for on_off + are: &true; for on and &false; for off. + + + Use of this function may provide performance improvements by buffering + small reads and writes of LOBs by reducing the number of network + round-trips and LOB versions. oci_lob_flush should + be used to flush buffers, when you have finished working with the large + object. + + + &return.success; + + + + + &reftitle.parameters; + + + + on_off + + + + + + + + + + + &reftitle.seealso; + + + + + + + + - - - lob->size - Returns size of large object - - - Description - - intlob->size - - - - Returns length of large object value or &false; in case of error. - Empty objects have zero length. - - - + + + + OCI-Lob->size + Returns size of large object + + + + &reftitle.description; + + OCI-Lob + + intsize + + + + + Returns length of large object value or &false; in case of error. + Empty objects have zero length. + + + + - - - lob->tell - Returns current position of internal pointer of large object - - - Description - - intlob->tell - - - - Returns current position of a LOB's internal pointer or &false; if an - error occurred. - - - See also oci_lob_size and - oci_lob_eof. - - - + + + + OCI-Lob->tell + Returns current position of internal pointer of large object + + + + &reftitle.description; + + OCI-Lob + + inttell + + + + + Returns current position of a LOB's internal pointer or &false; if an + error occurred. + + + + + &reftitle.seealso; + + + + + + + + + + + - - - lob->truncate - Truncates large object - - - Description - - boollob->truncate - intlength - - - If parameter length is given, - lob->truncate truncates large object to - length bytes. Otherwise, - lob->truncate will purge the LOB completely. - - - &return.success; - - - See also oci_lob_erase. - - - + + + + OCI-Lob->truncate + Truncates large object + + + + &reftitle.description; + + OCI-Lob + + booltruncate + intlength + + + + If parameter length is given, + OCI-Lob->truncate truncates large object to + length bytes. Otherwise, + OCI-Lob->truncate will purge the LOB completely. + + + &return.success; + + + + + &reftitle.parameters; + + + + length + + + + + + + + + + + &reftitle.seealso; + + + + + + + + - diff --git a/reference/oci8/functions/OCI-Lob-write.xml b/reference/oci8/functions/OCI-Lob-write.xml index f0c1f9d954..6b5c4f6480 100644 --- a/reference/oci8/functions/OCI-Lob-write.xml +++ b/reference/oci8/functions/OCI-Lob-write.xml @@ -1,33 +1,67 @@ - - - - lob->write - Writes data to the large object - - - Description - - intlob->write - stringdata - intlength - - - Writes data from the parameter data into the - current position of LOB's internal pointer. - If the parameter length is given, writing will - stop after length bytes have been written or the - end of data is reached, whichever comes first. - - - lob->write returns the number of bytes written or - &false; in case of error. - - - See also oci_lob_read. - - - + + + + OCI-Lob->write + Writes data to the large object + + + + &reftitle.description; + + OCI-Lob + + intwrite + stringdata + intlength + + + + Writes data from the parameter data into the + current position of LOB's internal pointer. + If the parameter length is given, writing will + stop after length bytes have been written or the + end of data is reached, whichever comes first. + + + OCI-Lob->write returns the number of bytes written or + &false; in case of error. + + + + + &reftitle.parameters; + + + + data + + + + + + + length + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + - - - lob->writeTemporary - Writes temporary large object - - - Description - - boollob->writeTemporary - stringdata - intlob_type - - - Creates a temporary large object and writes data - to it. - - - Parameter lob_type can be one of the following: - - - OCI_TEMP_BLOB is used to create temporary BLOBs - - - OCI_TEMP_CLOB is used to create temporary CLOBs - - - - - lob->writeTemporary creates a CLOB by default. - - - You should use oci_lob_close when the work with the - object is over. - - - &return.success; - - - - In PHP versions before 5.0.0 you must use ociwritetemporarylob instead. - This name still can be used, it was left as alias of - oci_lob_write_temporary for downwards compatability. - This, however, is deprecated and not recommended. - - - - See also oci_lob_close. - - - + + + + OCI-Lob->writeTemporary + Writes temporary large object + + + + &reftitle.description; + + OCI-Lob + + boolwriteTemporary + stringdata + intlob_type + + + + Creates a temporary large object and writes data + to it. + + + Parameter lob_type can be one of the following: + + + OCI_TEMP_BLOB is used to create temporary BLOBs + + + OCI_TEMP_CLOB is used to create temporary CLOBs + + + + + OCI-Lob->writeTemporary creates a CLOB by default. + + + You should use when the work with the + object is over. + + + &return.success; + + + + + &reftitle.parameters; + + + + lob_type + + + + + + + + + + + &reftitle.seealso; + + + + + + + + + oci_bind_by_name @@ -171,7 +171,7 @@ oci_close($conn);
- Remember, that this function strips trailing whitespace. See the following + Remember, this function strips trailing whitespaces. See the following example: @@ -262,3 +262,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-cancel.xml b/reference/oci8/functions/oci-cancel.xml index bf71c3a11d..b20938be6a 100644 --- a/reference/oci8/functions/oci-cancel.xml +++ b/reference/oci8/functions/oci-cancel.xml @@ -1,5 +1,5 @@ - + oci_cancel diff --git a/reference/oci8/functions/oci-close.xml b/reference/oci8/functions/oci-close.xml index b5e1d2e1d6..8e632c9338 100644 --- a/reference/oci8/functions/oci-close.xml +++ b/reference/oci8/functions/oci-close.xml @@ -1,5 +1,5 @@ - + oci_close @@ -17,11 +17,11 @@ - As non-persistent links are closed automatically at the end of script - execution, calling this function is not required. Because of this and - the method the extension uses to handle connection resources, - oci_close currently provides no actual - functionality. + Starting from the version 1.1 oci_close correctly + closes the Oracle connection. + Use oci8.old_oci_close_semantics + option to restore old behaviour of this function. @@ -29,7 +29,7 @@ - In PHP versions before 5.0.0 you must use ociclose instead. + In PHP versions before 5.0.0 you must use ocilogoff instead. This name still can be used, it was left as alias of oci_close for downwards compatability. This, however, is deprecated and not recommended. diff --git a/reference/oci8/functions/oci-commit.xml b/reference/oci8/functions/oci-commit.xml index 2a6e7358e3..4ddd1fb42d 100644 --- a/reference/oci8/functions/oci-commit.xml +++ b/reference/oci8/functions/oci-commit.xml @@ -1,5 +1,5 @@ - + oci_commit @@ -61,6 +61,14 @@ &return.success; + + + Transactions are automatically rolled back when you close + the connection, or when the script ends, whichever is soonest. You + need to explicitly call oci_commit to commit + the transaction, or oci_rollback to abort it. + + In PHP versions before 5.0.0 you must use ocicommit instead. diff --git a/reference/oci8/functions/oci-connect.xml b/reference/oci8/functions/oci-connect.xml index b84f927d10..417b3478b8 100644 --- a/reference/oci8/functions/oci-connect.xml +++ b/reference/oci8/functions/oci-connect.xml @@ -1,9 +1,9 @@ - + oci_connect - Establishes a connection to Oracle server + Establishes a connection to the Oracle server Description @@ -13,6 +13,7 @@ stringpassword stringdb stringcharset + intsession_mode oci_connect returns a connection identifier @@ -26,14 +27,41 @@ (tnsnames.ora) to determine which database to connect to. + + Parameter session_mode is available since version + 1.1 and accepts the following values: OCI_DEFAULT, + OCI_SYSOPER and OCI_SYSDBA. + If either OCI_SYSOPER or + OCI_SYSDBA were specified, + oci_connect will try to establish privileged + connection using external credentials. Privileged connections are + disabled by default. To enable them you need to set oci8.privileged_connect + to On. + - oci_connect does not reestablish - the connection, if a connection with such parameters was established - before. In this case, oci_connect will return - identifier of previously opened connection. This means, that you cannot - use this function to separate transactions. To establish a distinctly new - connection, use oci_new_connect. + If you're using PHP with Oracle Instant Client, you can use easy connect + naming method described here: + + http://download-west.oracle.com/docs/cd/B12037_01/network.101/b10775/naming.htm#i498306. + Basically this means you can specify "//db_host[:port]/database_name" + as database name. But if you want to use the old way of naming you + must set either ORACLE_HOME or + TNS_ADMIN. + + + + + The second and subsequent calls to oci_connect + with the same parameters will return the connection handle returned + from the first call. This means that queries issued against one + handle are also applied to the other handles, because they are the + same handle. This behaviour is demonstrated in + Example 1 below. If you require two handles to be transactionally + isolated from each other, you should use + oci_new_connect instead. &oci.charset; @@ -139,13 +167,15 @@ echo ""; In PHP versions before 5.0.0 you must use ocilogon instead. - This name still can be used, it was left as alias of + This name still can be used, it was left as the alias of oci_connect for downwards compatability. This, however, is deprecated and not recommended. - - See also oci_pconnect and - oci_new_connect. + + + See also oci_pconnect, + oci_new_connect and + oci_close. @@ -170,3 +200,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-define-by-name.xml b/reference/oci8/functions/oci-define-by-name.xml index 78f7103300..520a6d5e03 100644 --- a/reference/oci8/functions/oci-define-by-name.xml +++ b/reference/oci8/functions/oci-define-by-name.xml @@ -1,5 +1,5 @@ - + oci_define_by_name @@ -18,12 +18,12 @@ oci_define_by_name defines PHP variables for fetches - of SQL-Columns. Be careful that Oracle uses ALL-UPPERCASE column names, - whereby in your select you can also write lowercase. + of SQL-Columns. Take into consideration that Oracle uses ALL-UPPERCASE column names, + whereby in your select you can also use lowercase. oci_define_by_name expects the column_name to be in uppercase. If you define a variable that doesn't exists in your select statement, no - error will issued. + error will be issued. If you need to define an abstract datatype (LOB/ROWID/BFILE) you @@ -91,3 +91,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-error.xml b/reference/oci8/functions/oci-error.xml index a194850ffd..57ccd6ab47 100644 --- a/reference/oci8/functions/oci-error.xml +++ b/reference/oci8/functions/oci-error.xml @@ -1,5 +1,5 @@ - + oci_error diff --git a/reference/oci8/functions/oci-execute.xml b/reference/oci8/functions/oci-execute.xml index 14a07302dd..1829f22ada 100644 --- a/reference/oci8/functions/oci-execute.xml +++ b/reference/oci8/functions/oci-execute.xml @@ -1,5 +1,5 @@ - + oci_execute @@ -21,6 +21,13 @@ you should specify OCI_DEFAULT as your mode. + + When using OCI_DEFAULT mode, you're creating a + transaction. Transactions are automatically rolled back when you close + the connection, or when the script ends, whichever is soonest. You + need to explicitly call oci_commit to commit + the transaction, or oci_rollback to abort it. + &return.success; diff --git a/reference/oci8/functions/oci-fetch-all.xml b/reference/oci8/functions/oci-fetch-all.xml index c75a8a5305..76a207dc45 100644 --- a/reference/oci8/functions/oci-fetch-all.xml +++ b/reference/oci8/functions/oci-fetch-all.xml @@ -1,5 +1,5 @@ - + oci_fetch_all @@ -19,7 +19,7 @@ oci_fetch_all fetches all the rows from a result into a user-defined array. oci_fetch_all returns the number of rows - fetched or &false; in case of error. skip + fetched or &false; in case of an error. skip is the number of initial rows to ignore when fetching the result (default value of 0, to start at the first line). maxrows is the number of @@ -122,3 +122,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-fetch-array.xml b/reference/oci8/functions/oci-fetch-array.xml index 14ac673858..a0c4178bda 100644 --- a/reference/oci8/functions/oci-fetch-array.xml +++ b/reference/oci8/functions/oci-fetch-array.xml @@ -1,5 +1,5 @@ - - + + oci_fetch_array @@ -16,7 +16,7 @@ Returns an array, which corresponds to the next result row or &false; in - case of error or there is no more rows in the result. + case of error or there are no more rows in the result. oci_fetch_array returns an array with both @@ -24,7 +24,7 @@ &database.fetch-null; - Optional second parameter can be any combination of the following + An optional second parameter can be any combination of the following constants: @@ -58,8 +58,7 @@ - Don't forget, that Oracle returns all field names in uppercase and - associative indices in the result array will be uppercased too. + Oracle returns all field names in uppercase and associative indices in the result array will be uppercased too. @@ -185,3 +184,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-fetch-assoc.xml b/reference/oci8/functions/oci-fetch-assoc.xml index 9887e17439..38f59e6750 100644 --- a/reference/oci8/functions/oci-fetch-assoc.xml +++ b/reference/oci8/functions/oci-fetch-assoc.xml @@ -1,5 +1,5 @@ - + oci_fetch_assoc @@ -19,13 +19,12 @@ &database.fetch-null; - Subsequent call to oci_fetch_assoc will return - next row or &false; if there is no more rows. + A subsequent call to oci_fetch_assoc will return + the next row or &false; if there are no more rows. - Don't forget, that Oracle returns all field names in uppercase and - associative indices in the result array will be uppercased too. + Oracle returns all field names in uppercase and associative indices in the result array will be uppercased too. @@ -57,3 +56,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-fetch-object.xml b/reference/oci8/functions/oci-fetch-object.xml index 1d9f4ce797..1fffc162b7 100644 --- a/reference/oci8/functions/oci-fetch-object.xml +++ b/reference/oci8/functions/oci-fetch-object.xml @@ -1,5 +1,5 @@ - + oci_fetch_object @@ -18,12 +18,11 @@ &database.fetch-null; Subsequent calls to oci_fetch_object will return the - next row from the result or &false; if there is no more rows. + next row from the result or &false; if there are no more rows. - Don't forget, that Oracle returns all field names in uppercase and - attributes' names in the result object will be in uppercase as well. + Oracle returns all field names in uppercase and attributes' names in the result object will be in uppercase as well. @@ -55,3 +54,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-fetch-row.xml b/reference/oci8/functions/oci-fetch-row.xml index 47dbb40168..33253836bf 100644 --- a/reference/oci8/functions/oci-fetch-row.xml +++ b/reference/oci8/functions/oci-fetch-row.xml @@ -1,5 +1,5 @@ - + oci_fetch_row @@ -20,7 +20,7 @@ &database.fetch-null; Subsequent calls to oci_fetch_row will return the - next row from the result data or &false; if there is no more rows. + next row from the result data or &false; if there are no more rows. See also oci_fetch_array, @@ -51,3 +51,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-field-name.xml b/reference/oci8/functions/oci-field-name.xml index 1b0e6230f2..6a23fa2e8e 100644 --- a/reference/oci8/functions/oci-field-name.xml +++ b/reference/oci8/functions/oci-field-name.xml @@ -1,5 +1,5 @@ - + oci_field_name diff --git a/reference/oci8/functions/oci-field-precision.xml b/reference/oci8/functions/oci-field-precision.xml index 27e1eac1f9..c650998c28 100644 --- a/reference/oci8/functions/oci-field-precision.xml +++ b/reference/oci8/functions/oci-field-precision.xml @@ -1,5 +1,5 @@ - + oci_field_precision diff --git a/reference/oci8/functions/oci-field-scale.xml b/reference/oci8/functions/oci-field-scale.xml index 8448b52e8c..6bee9d6208 100644 --- a/reference/oci8/functions/oci-field-scale.xml +++ b/reference/oci8/functions/oci-field-scale.xml @@ -1,5 +1,5 @@ - + oci_field_scale diff --git a/reference/oci8/functions/oci-field-size.xml b/reference/oci8/functions/oci-field-size.xml index 204f39363f..e3ed60f145 100644 --- a/reference/oci8/functions/oci-field-size.xml +++ b/reference/oci8/functions/oci-field-size.xml @@ -1,5 +1,5 @@ - + oci_field_size diff --git a/reference/oci8/functions/oci-field-type-raw.xml b/reference/oci8/functions/oci-field-type-raw.xml index 8d11e755d9..6bbcba152a 100644 --- a/reference/oci8/functions/oci-field-type-raw.xml +++ b/reference/oci8/functions/oci-field-type-raw.xml @@ -1,5 +1,5 @@ - + oci_field_type_raw diff --git a/reference/oci8/functions/oci-field-type.xml b/reference/oci8/functions/oci-field-type.xml index f80678d9df..e59aaab798 100644 --- a/reference/oci8/functions/oci-field-type.xml +++ b/reference/oci8/functions/oci-field-type.xml @@ -1,5 +1,5 @@ - + oci_field_type diff --git a/reference/oci8/functions/oci-internal-debug.xml b/reference/oci8/functions/oci-internal-debug.xml index 6bd5b4efbf..ff59dbc1fe 100644 --- a/reference/oci8/functions/oci-internal-debug.xml +++ b/reference/oci8/functions/oci-internal-debug.xml @@ -1,5 +1,5 @@ - + oci_internal_debug diff --git a/reference/oci8/functions/oci-lob-copy.xml b/reference/oci8/functions/oci-lob-copy.xml index 67056365cb..73f2e99f2f 100644 --- a/reference/oci8/functions/oci-lob-copy.xml +++ b/reference/oci8/functions/oci-lob-copy.xml @@ -1,5 +1,5 @@ - + oci_lob_copy @@ -14,14 +14,13 @@ intlength - Copies large object or a part of large object to another large object. + Copies a large object or a part of a large object to another large object. Parameter length indicates the length of data to - be copied. Old data of LOB-recipient will be overwritten. + be copied. Old LOB-recipient data will be overwritten. - If you need to copy a particular part of LOB to a particular position of - LOB, you can use oci_lob_seek to move internal - pointers of LOBs. + If you need to copy a particular part of a LOB to a particular position of + a LOB, use oci_lob_seek to move LOB internal pointers. &return.success; @@ -50,3 +49,4 @@ vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-new-collection.xml b/reference/oci8/functions/oci-new-collection.xml index df198d6d4b..e4a672750a 100644 --- a/reference/oci8/functions/oci-new-collection.xml +++ b/reference/oci8/functions/oci-new-collection.xml @@ -1,5 +1,5 @@ - + oci_new_collection @@ -14,11 +14,11 @@ stringschema - Allocates new collection object. Parameter tdo - should be a valid named type (uppercased). Third, optional parameter + Allocates a new collection object. Parameter tdo + should be a valid named type (uppercase). The third, optional parameter schema should point to the scheme, where the named type was created. oci_new_collection uses - name of the current user as default value of schema. + the name of the current user as the default value of schema. oci_new_collection returns &false; on error. @@ -54,3 +54,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + diff --git a/reference/oci8/functions/oci-new-connect.xml b/reference/oci8/functions/oci-new-connect.xml index 33dff0face..ec36801d30 100644 --- a/reference/oci8/functions/oci-new-connect.xml +++ b/reference/oci8/functions/oci-new-connect.xml @@ -1,5 +1,5 @@ - + oci_new_connect @@ -13,24 +13,50 @@ stringpassword stringdb stringcharset + intsession_mode - oci_new_connect creates a new connection to an Oracle - server and logs on. The optional third parameter can either contain the name + oci_new_connect establishes a new connection to + an Oracle server and logs on. Unlike oci_connect and + oci_pconnect, oci_new_connect + does not cache connections and will always return a brand-new freshly + opened connection handle. This is useful if your application needs + transactional isolation between two sets of queries. + + + The optional third parameter can either contain the name of the local Oracle instance or the name of the entry in tnsnames.ora. If the third parameter is not specified, PHP uses environment variables ORACLE_SID and TWO_TASK to determine the name of local Oracle instance and location of tnsnames.ora accordingly. - &oci.charset; - oci_new_connect forces the creation of a new connection. - This should be used if you need to isolate a set of transactions. By - default, connections are shared and subsequent calls to - oci_connect will return the same connection - identifier. + Parameter session_mode is available since version + 1.1 and accepts the following values: OCI_DEFAULT, + OCI_SYSOPER and OCI_SYSDBA. + If either OCI_SYSOPER or + OCI_SYSDBA were specified, + oci_new_connect will try to establish privileged + connection using external credentials. Privileged connections are + disabled by default. To enable them you need to set oci8.privileged_connect + to On. + + + If you're using PHP with Oracle Instant Client, you can use easy connect + naming method described here: + + http://download-west.oracle.com/docs/cd/B12037_01/network.101/b10775/naming.htm#i498306. + Basically this means you can specify "//db_host[:port]/database_name" + as database name. But if you want to use the old way of naming you + must set either ORACLE_HOME or + TNS_ADMIN. + + + &oci.charset; The following demonstrates how you can separate connections. diff --git a/reference/oci8/functions/oci-new-cursor.xml b/reference/oci8/functions/oci-new-cursor.xml index 075eae6d8e..3aee118283 100644 --- a/reference/oci8/functions/oci-new-cursor.xml +++ b/reference/oci8/functions/oci-new-cursor.xml @@ -1,5 +1,5 @@ - + oci_new_cursor diff --git a/reference/oci8/functions/oci-new-descriptor.xml b/reference/oci8/functions/oci-new-descriptor.xml index 9d0ad7f654..6b3d048a9e 100644 --- a/reference/oci8/functions/oci-new-descriptor.xml +++ b/reference/oci8/functions/oci-new-descriptor.xml @@ -1,5 +1,5 @@ - + oci_new_descriptor diff --git a/reference/oci8/functions/oci-num-rows.xml b/reference/oci8/functions/oci-num-rows.xml index e3346d333d..0185539d6c 100644 --- a/reference/oci8/functions/oci-num-rows.xml +++ b/reference/oci8/functions/oci-num-rows.xml @@ -1,5 +1,5 @@ - + oci_num_rows diff --git a/reference/oci8/functions/oci-parse.xml b/reference/oci8/functions/oci-parse.xml index 6a099a49c7..98dfc51976 100644 --- a/reference/oci8/functions/oci-parse.xml +++ b/reference/oci8/functions/oci-parse.xml @@ -1,5 +1,5 @@ - + oci_parse diff --git a/reference/oci8/functions/oci-password-change.xml b/reference/oci8/functions/oci-password-change.xml index 76fdd858b4..a0effe6fb9 100644 --- a/reference/oci8/functions/oci-password-change.xml +++ b/reference/oci8/functions/oci-password-change.xml @@ -1,5 +1,5 @@ - + oci_password_change @@ -14,12 +14,25 @@ stringold_password stringnew_password + + resourceoci_password_change + stringdbname + stringusername + stringold_password + stringnew_password + Changes password for user with username. Parameters old_password and new_password should indicate old and new passwords respectively. + + + The second oci_password_change syntax is available + since version 1.1. + + &return.success; diff --git a/reference/oci8/functions/oci-pconnect.xml b/reference/oci8/functions/oci-pconnect.xml index dd981e7468..6b9a93e8cd 100644 --- a/reference/oci8/functions/oci-pconnect.xml +++ b/reference/oci8/functions/oci-pconnect.xml @@ -1,5 +1,5 @@ - + oci_pconnect @@ -13,29 +13,66 @@ stringpassword stringdb stringcharset + intsession_mode - oci_pconnect creates a new persistent connection to - an Oracle server and logs on. The optional third parameter can either contain + oci_pconnect creates a persistent connection + to an Oracle server and logs on. Persistent connections are cached + and re-used between requests, resulting in reduced overhead on each + page load; a typical PHP application will have a single persistent + connection open against an Oracle server per Apache child process + (or PHP FastCGI/CGI process). See the Persistent Database + Connections section for more information. + + + + Starting with version 1.1 of the oci8 extension, the lifetime and + maximum amount of persistent Oracle connections can be tuned by setting + the following configuration values: oci8.persistent_timeout, + oci8.ping_interval and + oci8.max_persistent. + + + + The optional third parameter can either contain the name of the local Oracle instance or the name of the entry in tnsnames.ora. If the third parameter is not specified, PHP uses environment variables ORACLE_SID and TWO_TASK to determine the name of local Oracle instance and location of tnsnames.ora accordingly. + + Parameter session_mode is available since version + 1.1 and accepts the following values: OCI_DEFAULT, + OCI_SYSOPER and OCI_SYSDBA. + If either OCI_SYSOPER or + OCI_SYSDBA were specified, + oci_connect will try to establish privileged + connection using external credentials. Privileged connections are + disabled by default. To enable them you need to set oci8.privileged_connect + to On. + + + + If you're using PHP with Oracle Instant Client, you can use easy connect + naming method described here: + + http://download-west.oracle.com/docs/cd/B12037_01/network.101/b10775/naming.htm#i498306. + Basically this means you can specify "//db_host[:port]/database_name" + as database name. But if you want to use the old way of naming you + must set either ORACLE_HOME or + TNS_ADMIN. + + &oci.charset; oci_pconnect returns connection identifier or &false; on error. - - - Note, that these kind of links only work if you are using - a module version of PHP. See the - Persistent - Database Connections section for more information. - - In PHP versions before 5.0.0 you must use ociplogon instead. diff --git a/reference/oci8/functions/oci-rollback.xml b/reference/oci8/functions/oci-rollback.xml index bce6087fd6..b139eb5e4c 100644 --- a/reference/oci8/functions/oci-rollback.xml +++ b/reference/oci8/functions/oci-rollback.xml @@ -1,5 +1,5 @@ - + oci_rollback @@ -18,6 +18,14 @@ &return.success; + + + Transactions are automatically rolled back when you close + the connection, or when the script ends, whichever is soonest. You + need to explicitly call oci_commit to commit + the transaction, or oci_rollback to abort it. + + In PHP versions before 5.0.0 you must use ocirollback instead. diff --git a/reference/oci8/functions/oci-server-version.xml b/reference/oci8/functions/oci-server-version.xml index 06e7e66140..c9cc375c96 100644 --- a/reference/oci8/functions/oci-server-version.xml +++ b/reference/oci8/functions/oci-server-version.xml @@ -1,5 +1,5 @@ - + oci_server_version diff --git a/reference/oci8/functions/oci-set-prefetch.xml b/reference/oci8/functions/oci-set-prefetch.xml index a6448efb98..27ade9c490 100644 --- a/reference/oci8/functions/oci-set-prefetch.xml +++ b/reference/oci8/functions/oci-set-prefetch.xml @@ -1,5 +1,5 @@ - + oci_set_prefetch @@ -28,6 +28,11 @@ &return.success; + + See also oci8_.default_prefetch + ini option. + diff --git a/reference/oci8/functions/oci-statement-type.xml b/reference/oci8/functions/oci-statement-type.xml index 5f106d788e..3726e9bb83 100644 --- a/reference/oci8/functions/oci-statement-type.xml +++ b/reference/oci8/functions/oci-statement-type.xml @@ -1,5 +1,5 @@ - + oci_statement_type diff --git a/reference/oci8/functions/ocibindbyname.xml b/reference/oci8/functions/ocibindbyname.xml index 5c1c7a015d..ca48f0b6ea 100644 --- a/reference/oci8/functions/ocibindbyname.xml +++ b/reference/oci8/functions/ocibindbyname.xml @@ -1,131 +1,19 @@ - - + + + ocibindbyname + &Alias; oci_bind_by_name + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocibindbyname - - Bind a PHP variable to an Oracle Placeholder - - - - Description - - boolocibindbyname - resourcestmt - stringph_name - mixedvariable - intmaxlength - inttype - - - ocibindbyname binds the PHP variable - variable to the Oracle placeholder - ph_name. Whether it will be used for - input or output will be determined run-time, and the necessary - storage space will be allocated. The - length parameter sets the maximum length - for the bind. If you set length to -1 - ocibindbyname will use the current length of - variable to set the maximum length. - - - If you need to bind an abstract Datatype (LOB/ROWID/BFILE) you - need to allocate it first using - ocinewdescriptor function. The - length is not used for abstract Datatypes - and should be set to -1. The type variable - tells oracle, what kind of descriptor we want to use. Possible - values are: OCI_B_FILE (Binary-File), OCI_B_CFILE - (Character-File), OCI_B_CLOB (Character-LOB), OCI_B_BLOB - (Binary-LOB) and OCI_B_ROWID (ROWID). - - - - <function>ocibindbyname</function> example - - "Larry", 2222 => "Bill", 3333 => "Jim"); - -$rowid = OCINewDescriptor($conn, OCI_D_ROWID); - -OCIBindByName($stmt, ":empno", $empno, 32); -OCIBindByName($stmt, ":ename", $ename, 32); -OCIBindByName($stmt, ":rid", $rowid, -1, OCI_B_ROWID); - -$update = OCIParse($conn, "update emp set sal = :sal where ROWID = :rid"); -OCIBindByName($update, ":rid", $rowid, -1, OCI_B_ROWID); -OCIBindByName($update, ":sal", $sal, 32); - -$sal = 10000; - -foreach ($data as $empno => $ename) { - OCIExecute($stmt); - OCIExecute($update); -} - -$rowid->free(); - -OCIFreeStatement($update); -OCIFreeStatement($stmt); - -$stmt = OCIParse($conn, "select * from emp where empno in (1111,2222,3333)"); -OCIExecute($stmt); -while (OCIFetchInto($stmt, &$arr, OCI_ASSOC)) { - var_dump($arr); -} -OCIFreeStatement($stmt); - -/* delete our "junk" from the emp table.... */ -$stmt = OCIParse($conn, "delete from emp where empno in (1111,2222,3333)"); -OCIExecute($stmt); -OCIFreeStatement($stmt); - -OCILogoff($conn); -?> -]]> - - - - - - This function was renamed to oci_bind_by_name - after PHP >= 5.0.0. For downward compatibility - ocibindbyname can also be used. - This is deprecated, however. - - - - - It is a bad idea to use magic quotes and - ocibindbyname simultaneously as no quoting - is needed on quoted variables and any quotes magically applied - will be written into your database as - ocibindbyname is not able to distinguish - magically added quotings from those added by intention. - - - - + + &reftitle.description; + + &info.function.alias; + oci_bind_by_name. + + + - + + + ocicancel + &Alias; oci_cancel + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicancel - Cancel reading from cursor - - - Description - - boolocicancel - resourcestmt - - - If you do not want read more data from a cursor, then call - ocicancel. - - - - This function was renamed to oci_cancel - after PHP >= 5.0.0. For downward compatibility - ocicancel can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_cancel. + + + - + + + ocicloselob + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicloselob - Closes lob descriptor - - - Description - - boolocicloselob - - - - - This function was renamed to oci_lob_close - after PHP >= 5.0.0. For downward compatibility - ocicloselob can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocicollappend + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicollappend - Append an object to the collection - - - Description - - boolocicollappend - stringvalue - - - - This function was renamed to oci_collection_append - after PHP >= 5.0.0. For downward compatibility - ocicollappend can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocicollassign + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicollassign - Assign a collection from another existing collection - - - Description - - boolocicollassign - OCI-Collectionfrom - - - - This function was renamed to oci_collection_assign - after PHP >= 5.0.0. For downward compatibility - ocicollassign can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocicollassignelem + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicollassignelem - Assign element val to collection at index ndx - - - Description - - boolocicollassignelem - intndx - stringval - - - - This function was renamed to oci_collection_element_assign - after PHP >= 5.0.0. For downward compatibility - ocicollassignelem can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocicollgetelem + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicollgetelem - Retrieve the value at collection index ndx - - - Description - - stringocicollgetelem - intndx - - - - This function was renamed to oci_collection_element_get - after PHP >= 5.0.0. For downward compatibility - ocicollgetelem can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocicollmax + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicollmax - Gets the maximum number of elements in the collection - - - Description - - intocicollmax - - - - - This function was renamed to oci_collection_max - after PHP >= 5.0.0. For downward compatibility - ocicollmax can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocicollsize + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicollsize - Return the size of a collection - - - Description - - intocicollsize - - - - - This function was renamed to oci_collection_size - after PHP >= 5.0.0. For downward compatibility - ocicollsize can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocicolltrim + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicolltrim - Trim num elements from the end of a collection - - - Description - - boolocicolltrim - intnum - - - - This function was renamed to oci_collection_trim - after PHP >= 5.0.0. For downward compatibility - ocicolltrim can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocicolumnisnull + &Alias; oci_field_is_null + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicolumnisnull - Test whether a result column is &null; - - - Description - - boolocicolumnisnull - resourcestmt - mixedcol - - - ocicolumnisnull returns &true; if the returned - column column in the result from the - statement stmt is &null;. You can either use - the column-number (1-Based) or the column-name, in uppercase, for the - col parameter. - - - - This function was renamed to oci_field_is_null - after PHP >= 5.0.0. For downward compatibility - ocicolumnisnull can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_field_is_null. + + + - + + + ocicolumnname + &Alias; oci_field_name + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicolumnname - Returns the name of a column - - - Description - - stringocicolumnname - resourcestmt - intcol - - - ocicolumnname returns the name of the column - corresponding to the column number (1-based) that is passed in. - - - - <function>ocicolumnname</function> example - -"; - echo ""; - echo "Name"; - echo "Type"; - echo "Length"; - echo ""; - $ncols = OCINumCols($stmt); - for ($i = 1; $i <= $ncols; $i++) { - $column_name = OCIColumnName($stmt, $i); - $column_type = OCIColumnType($stmt, $i); - $column_size = OCIColumnSize($stmt, $i); - echo ""; - echo "$column_name"; - echo "$column_type"; - echo "$column_size"; - echo ""; - } - echo "\n"; - OCIFreeStatement($stmt); - OCILogoff($conn); -?> -]]> - - - - - - This function was renamed to oci_field_name - after PHP >= 5.0.0. For downward compatibility - ocicolumnname can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_field_name. + + + - + + + ocicolumnprecision + &Alias; oci_field_precision + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicolumnprecision - Tell the precision of a column - - - Description - - intocicolumnprecision - resourcestmt - intcol - - - Returns precision of the field with col index - (1-based). - - - For FLOAT columns precision is nonzero and scale is -127. - If precision is 0, then columnt is NUMBER. Else it's - NUMBER(precision, scale). - - - - This function was renamed to oci_field_precision - after PHP >= 5.0.0. For downward compatibility - ocicolumnprecision can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_field_precision. + + + - + + + ocicolumnscale + &Alias; oci_field_scale + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicolumnscale - Tell the scale of a column - - - Description - - intocicolumnscale - resourcestmt - intcol - - - - This function was renamed to oci_field_scale - after PHP >= 5.0.0. For downward compatibility - ocicolumnscale can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_field_scale. + + + - + + + ocicolumnsize + &Alias; oci_field_size + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicolumnsize - Return result column size - - - Description - - intocicolumnsize - resourcestmt - mixedcolumn - - - ocicolumnsize returns the size of the column - as given by Oracle. You can either use - the column-number (1-Based) or the column-name for the - column parameter. - - - - <function>ocicolumnsize</function> example - -"; - echo ""; - echo "Name"; - echo "Type"; - echo "Length"; - echo ""; - $ncols = OCINumCols($stmt); - for ($i = 1; $i <= $ncols; $i++) { - $column_name = OCIColumnName($stmt, $i); - $column_type = OCIColumnType($stmt, $i); - $column_size = OCIColumnSize($stmt, $i); - echo ""; - echo "$column_name"; - echo "$column_type"; - echo "$column_size"; - echo ""; - } - echo ""; - OCIFreeStatement($stmt); - OCILogoff($conn); -?> -]]> - - - - - - This function was renamed to oci_field_size - after PHP >= 5.0.0. For downward compatibility - ocicolumnsize can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_field_size. + + + - + + + ocicolumntype + &Alias; oci_field_type + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicolumntype - Returns the data type of a column - - - Description - - mixedocicolumntype - resourcestmt - intcol - - - ocicolumntype returns the data type of the - column corresponding to the column number (1-based) that is passed - in. - - - - <function>ocicolumntype</function> example - -"; - echo ""; - echo "Name"; - echo "Type"; - echo "Length"; - echo ""; - $ncols = OCINumCols($stmt); - for ($i = 1; $i <= $ncols; $i++) { - $column_name = OCIColumnName($stmt, $i); - $column_type = OCIColumnType($stmt, $i); - $column_size = OCIColumnSize($stmt, $i); - echo ""; - echo "$column_name"; - echo "$column_type"; - echo "$column_size"; - echo ""; - } - echo "\n"; - OCIFreeStatement($stmt); - OCILogoff($conn); -?> -]]> - - - - - - This function was renamed to oci_field_type - after PHP >= 5.0.0. For downward compatibility - ocicolumntype can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_field_type. + + + - + + + ocicolumntyperaw + &Alias; oci_field_type_raw + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicolumntyperaw - Tell the raw oracle data type of a column - - - Description - - intocicolumntyperaw - resourcestmt - intcol - - - ocicolumntyperaw returns Oracle's raw data type of the - field. - - - - This function was renamed to oci_field_type_raw - after PHP >= 5.0.0. For downward compatibility - ocicolumntyperaw can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_field_type_raw. + + + - + + + ocicommit + &Alias; oci_commit + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocicommit - Commits outstanding transactions - - - Description - - boolocicommit - resourceconnection - - - ocicommit commits all outstanding statements - for the active transaction on Oracle connection connection. - &return.success; - - - This example demonstrates how ocicommit is used. - - <function>ocicommit</function> example - - -]]> - - - - - - This function was renamed to oci_commit - after PHP >= 5.0.0. For downward compatibility - ocicommit can also be used. - This is deprecated, however. - - - - See also ocirollback. - - - + + &reftitle.description; + + &info.function.alias; + oci_commit. + + + - + + + ocidefinebyname + &Alias; oci_define_by_name + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocidefinebyname - - Use a PHP variable for the define-step during a SELECT - - - - Description - - boolocidefinebyname - resourcestmt - stringcolumn_name - mixedvariable - inttype - - - ocidefinebyname binds PHP variables for fetches - of SQL-Columns. Be careful that Oracle uses ALL-UPPERCASE column-names, - whereby in your select you can also write lowercase. - ocidefinebyname expects - the column_name to be in uppercase. If you - define a variable that doesn't exists in your select statement, no - error will be given! - - - If you need to define an abstract datatype (LOB/ROWID/BFILE) you - need to allocate it first using - ocinewdescriptor. See also the - ocibindbyname function. - - - <function>ocidefinebyname</function> example - - -]]> - - - - - This function was renamed to oci_define_by_name - after PHP >= 5.0.0. For downward compatibility - ocidefinebyname can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_define_by_name. + + + - + + + ocierror + &Alias; oci_error + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocierror - Return the last error of stmt|conn|global - - - Description - - arrayocierror - resourcestmt_or_conn_or_global - - - ocierror returns the last error found. If - the optional stmt_or_conn_or_global is not - provided, the last error encountered is returned. If no error is - found, ocierror returns - &false;. ocierror returns the error as an - associative array. In this array, code - consists the oracle error code and message - the oracle errorstring. - - - As of PHP 4.3 - - offset and sqltext will - also be included in the return array to indicate the location - of the error and the original SQL text which caused it. - - - - - This function was renamed to oci_error - after PHP >= 5.0.0. For downward compatibility - ocierror can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_error. + + + - + + + ociexecute + &Alias; oci_execute + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociexecute - Execute a statement - - - Description - - boolociexecute - resourcestmt - intmode - - - ociexecute executes a previously parsed - statement. (see ociparse). The optional - mode allows you to specify the - execution-mode (default is OCI_COMMIT_ON_SUCCESS). If you don't - want statements to be committed automatically specify OCI_DEFAULT as - your mode. - - - - This function was renamed to oci_execute - after PHP >= 5.0.0. For downward compatibility - ociexecute can also be used. - This is deprecated, however. - - - - &return.success; - - - + + &reftitle.description; + + &info.function.alias; + oci_execute. + + + - + + + ocifetch + &Alias; oci_fetch + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocifetch - Fetches the next row into result-buffer - - - Description - - boolocifetch - resourcestmt - - - ocifetch fetches the next row (for SELECT - statements) into the internal result-buffer. &return.success; - - - - This function was renamed to oci_fetch - after PHP >= 5.0.0. For downward compatibility - ocifetch can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_fetch. + + + - + ocifetchinto diff --git a/reference/oci8/functions/ocifetchstatement.xml b/reference/oci8/functions/ocifetchstatement.xml index 75c9922c17..4b846dc8b6 100644 --- a/reference/oci8/functions/ocifetchstatement.xml +++ b/reference/oci8/functions/ocifetchstatement.xml @@ -1,44 +1,20 @@ + - - + + + ocifetchistatement + &Alias; oci_fetch_all + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS DEPRECATED. - ---> - - - - ocifetchstatement - Fetch all rows of result data into an array - - - Description - - intocifetchstatement - resourcestmt - arrayoutput - intskip - intmaxrows - intflags - - - - In PHP 5.0.0 this function became an alias for - oci_fetch_all. - This name still can be used, it was left as alias of - oci_fetch_all for downwards compatability. - This, however, is deprecated and not recommended. - - - - See also oci_fetch_array, - oci_fetch_assoc, - oci_fetch_object, - oci_fetch_row. - - - + + &reftitle.description; + + &info.function.alias; + oci_fetch_all. + + + - + + + ocifreecollection + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocifreecollection - Deletes collection object - - - Description - - boolocifreecollection - - - - - This function was renamed to oci_free_collection - after PHP >= 5.0.0. For downward compatibility - ocifreecollection can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocifreecursor + &Alias; oci_free_statement + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocifreecursor - - Free all resources associated with a cursor - - - - Description - - boolocifreecursor - resourcestmt - - - ocifreecursor frees all resources associated with the - cursor stmt. &return.success; - - - - This function was renamed to oci_free_cursor - after PHP >= 5.0.0. For downward compatibility - ocifreecursor can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_free_statement. + + + - + + + ocifreedesc + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocifreedesc - Deletes a large object descriptor - - - Description - - boolocifreedesc - - - - ocifreedesc deletes a large object descriptor. - &return.success; - - - - This function was renamed to oci_free_descriptor - after PHP >= 5.0.0. For downward compatibility - ocifreedesc can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocifreestatement + &Alias; oci_free_statement + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocifreestatement - - Free all resources associated with a statement - - - - Description - - boolocifreestatement - resourcestmt - - - ocifreestatement free all resources associated - with the statement stmt. &return.success; - - - - This function was renamed to oci_free_statement - after PHP >= 5.0.0. For downward compatibility - ocifreestatement can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_free_statement. + + + - + + + ociinternaldebug + &Alias; oci_internal_debug + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociinternaldebug - - Enables or disables internal debug output - - - - Description - - voidociinternaldebug - intonoff - - - ociinternaldebug enables internal debug - output. Set onoff to 0 to turn debug - output off, 1 to turn it on. - - - - This function was renamed to oci_internal_debug - after PHP >= 5.0.0. For downward compatibility - ociinternaldebug can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_internal_debug. + + + - + + + ociloadlob + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociloadlob - Loads a large object - - - Description - - stringociloadlob - - - - - This function was renamed to oci_lob_load - after PHP >= 5.0.0. For downward compatibility - ociloadlob can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocilogoff + &Alias; oci_close + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocilogoff - Disconnects from Oracle server - - - Description - - boolocilogoff - resourceconnection - - - ocilogoff closes the Oracle connection - connection. - - - Using ocilogoff isn't usually necessary, - as non-persistent open links are automatically closed at the end - of the script's execution. See also - freeing - resources. - - - - This function was renamed to oci_close - after PHP >= 5.0.0. For downward compatibility - ocilogoff can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_close. + + + - + + + ocilogon + &Alias; oci_connect + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocilogon - Establishes a connection to Oracle - - - Description - - resourceocilogon - stringusername - stringpassword - stringdb - stringcharset - - - ocilogon returns an connection identifier - needed for most other OCI calls. The optional third parameter - can either contain the name of the local Oracle instance or the - name of the entry in tnsnames.ora to which you want to connect. - If the optional third parameter is not specified, PHP uses the - environment variables ORACLE_SID (Oracle instance) or TWO_TASK - (tnsnames.ora) to determine which database to connect to. - - &oci.charset; - Connections are shared at the page level when using - ocilogon. This means that commits and - rollbacks apply to all open transactions in the page, even if you - have created multiple connections. - - - This example demonstrates how the connections are shared. - - <function>ocilogon</function> example - -"; -$db = ""; - -$c1 = ocilogon("scott", "tiger", $db); -$c2 = ocilogon("scott", "tiger", $db); - -function create_table($conn) -{ - $stmt = ociparse($conn, "create table scott.hallo (test varchar2(64))"); - ociexecute($stmt); - echo $conn . " created table\n\n"; -} - -function drop_table($conn) -{ - $stmt = ociparse($conn, "drop table scott.hallo"); - ociexecute($stmt); - echo $conn . " dropped table\n\n"; -} - -function insert_data($conn) -{ - $stmt = ociparse($conn, "insert into scott.hallo - values('$conn' || ' ' || to_char(sysdate,'DD-MON-YY HH24:MI:SS'))"); - ociexecute($stmt, OCI_DEFAULT); - echo $conn . " inserted hallo\n\n"; -} - -function delete_data($conn) -{ - $stmt = ociparse($conn, "delete from scott.hallo"); - ociexecute($stmt, OCI_DEFAULT); - echo $conn . " deleted hallo\n\n"; -} - -function commit($conn) -{ - ocicommit($conn); - echo $conn . " committed\n\n"; -} - -function rollback($conn) -{ - ocirollback($conn); - echo $conn . " rollback\n\n"; -} - -function select_data($conn) -{ - $stmt = ociparse($conn, "select * from scott.hallo"); - ociexecute($stmt, OCI_DEFAULT); - echo $conn."----selecting\n\n"; - while (ocifetch($stmt)) { - echo $conn . " [" . ociresult($stmt, "TEST") . "]\n\n"; - } - echo $conn . "----done\n\n"; -} - -create_table($c1); -insert_data($c1); // Insert a row using c1 -insert_data($c2); // Insert a row using c2 - -select_data($c1); // Results of both inserts are returned -select_data($c2); - -rollback($c1); // Rollback using c1 - -select_data($c1); // Both inserts have been rolled back -select_data($c2); - -insert_data($c2); // Insert a row using c2 -commit($c2); // Commit using c2 - -select_data($c1); // Result of c2 insert is returned - -delete_data($c1); // Delete all rows in table using c1 -select_data($c1); // No rows returned -select_data($c2); // No rows returned -commit($c1); // Commit using c1 - -select_data($c1); // No rows returned -select_data($c2); // No rows returned - -drop_table($c1); -echo ""; -?> -]]> - - - - - - This function was renamed to oci_connect - after PHP >= 5.0.0. For downward compatibility - ocilogon can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_connect. + + + - + + + ocinewcollection + &Alias; oci_new_collection + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocinewcollection - Initialize a new collection - - - Description - - OCI-Collectionocinewcollection - resourceconnection - stringtdo - stringschema - - - - This function was renamed to oci_new_collection - after PHP >= 5.0.0. For downward compatibility - ocinewcollection can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_new_collection. + + + - + + + ocinewcursor + &Alias; oci_new_cursor + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocinewcursor - - Return a new cursor (Statement-Handle) - - - - Description - - resourceocinewcursor - resourceconn - - - ocinewcursor allocates a new statement handle - on the specified connection. - - - - Using a REF CURSOR from a stored procedure in Oracle - - -]]> - - - - - - Using a REF CURSOR in a select statement in Oracle - -"; -$conn = OCILogon("scott", "tiger"); -$count_cursor = "CURSOR(select count(empno) num_emps from emp " . - "where emp.deptno = dept.deptno) as EMPCNT from dept"; -$stmt = OCIParse($conn, "select deptno,dname,$count_cursor"); - -ociexecute($stmt); -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; -echo ""; - -while (OCIFetchInto($stmt, &$data, OCI_ASSOC)) { - echo ""; - $dname = $data["DNAME"]; - $deptno = $data["DEPTNO"]; - echo ""; - echo ""; - ociexecute($data["EMPCNT"]); - while (OCIFetchInto($data["EMPCNT"], &$subdata, OCI_ASSOC)) { - $num_emps = $subdata["NUM_EMPS"]; - echo ""; - } - echo ""; -} -echo "
DEPT NAMEDEPT ## EMPLOYEES
$dname$deptno$num_emps
"; -echo ""; -OCIFreeStatement($stmt); -OCILogoff($conn); -?> -]]> -
-
-
- - - This function was renamed to oci_new_cursor - after PHP >= 5.0.0. For downward compatibility - ocinewcursor can also be used. - This is deprecated, however. - - -
-
+ + &reftitle.description; + + &info.function.alias; + oci_new_cursor. + + +
- + + + ocinewscriptor + &Alias; oci_new_descriptor + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocinewdescriptor - - Initialize a new empty LOB or FILE descriptor - - - - Description - - OCI-Lobocinewdescriptor - resourceconnection - inttype - - - ocinewdescriptor allocates storage to hold - descriptors or LOB locators. Valid values for - type are OCI_D_FILE, - OCI_D_LOB and OCI_D_ROWID. - For LOB descriptors, the methods load, save, and savefile are - associated with the descriptor, for BFILE only the load method - exists. See the second example usage hints. - - - - <function>ocinewdescriptor</function> example - - -]]> - - - - * - * ... - */ - if (!isset($lob_upload) || $lob_upload == 'none'){ -?> -
-Upload file:
- - -
-savefile($lob_upload)){ - OCICommit($conn); - echo "Blob successfully uploaded\n"; - }else{ - echo "Couldn't upload Blob\n"; - } - OCIFreeDesc($lob); - OCIFreeStatement($stmt); - OCILogoff($conn); - } -?> -]]> -
-
- - <function>ocinewdescriptor</function> second example - -= 4.0.6). - * Example PL/SQL stored procedure signature is: - * - * PROCEDURE save_data - * Argument Name Type In/Out Default? - * ------------------------------ ----------------------- ------ -------- - * KEY NUMBER(38) IN - * DATA CLOB IN - * - */ - - $conn = OCILogon($user, $password); - $stmt = OCIParse($conn, "begin save_data(:key, :data); end;"); - $clob = OCINewDescriptor($conn, OCI_D_LOB); - OCIBindByName($stmt, ':key', $key); - OCIBindByName($stmt, ':data', $clob, -1, OCI_B_CLOB); - $clob->WriteTemporary($data); - OCIExecute($stmt, OCI_DEFAULT); - OCICommit($conn); - $clob->close(); - $clob->free(); - OCIFreeStatement($stmt); -?> -]]> - - -
- - - This function was renamed to oci_new_descriptor - after PHP >= 5.0.0. For downward compatibility - ocinewdescriptor can also be used. - This is deprecated, however. - - -
-
+ + &reftitle.description; + + &info.function.alias; + oci_new_descriptor. + + +
- + + + ocinlogon + &Alias; oci_new_connect + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocinlogon - Establishes a new connection to Oracle - - - Description - - resourceocinlogon - stringusername - stringpassword - stringdb - stringcharset - - - ocinlogon creates a new connection to an - Oracle 8 database and logs on. The optional third parameter can - either contain the name of the local Oracle instance or the name - of the entry in tnsnames.ora to which you want to connect. If - the optional third parameter is not specified, PHP uses the - environment variables ORACLE_SID (Oracle instance) or TWO_TASK - (tnsnames.ora) to determine which database to connect to. - - - ocinlogon forces a new connection. This - should be used if you need to isolate a set of transactions. By - default, connections are shared at the page level if using - ocilogon or at the web server process level - if using ociplogon. If you have multiple - connections open using ocinlogon, all - commits and rollbacks apply to the specified connection only. - - &oci.charset; - - This example demonstrates how the connections are separated. - - <function>ocinlogon</function> example - -
";
-$db = "";
-
-$c1 = ocilogon("scott", "tiger", $db);
-$c2 = ocinlogon("scott", "tiger", $db);
-
-function create_table($conn) 
-{
-  $stmt = ociparse($conn, "create table scott.hallo (test
-varchar2(64))");
-  ociexecute($stmt);
-  echo $conn . " created table\n\n";
-}
-
-function drop_table($conn) 
-{
-  $stmt = ociparse($conn, "drop table scott.hallo");
-  ociexecute($stmt);
-  echo $conn . " dropped table\n\n";
-}
-
-function insert_data($conn) 
-{
-  $stmt = ociparse($conn, "insert into scott.hallo 
-            values('$conn' || ' ' || to_char(sysdate,'DD-MON-YY HH24:MI:SS'))");
-  ociexecute($stmt, OCI_DEFAULT);
-  echo $conn . " inserted hallo\n\n";
-}
-
-function delete_data($conn) 
-{
-  $stmt = ociparse($conn, "delete from scott.hallo");
-  ociexecute($stmt, OCI_DEFAULT);
-  echo $conn . " deleted hallo\n\n";
-}
-
-function commit($conn) 
-{
-  ocicommit($conn);
-  echo $conn . " committed\n\n";
-}
-
-function rollback($conn) 
-{
-  ocirollback($conn);
-  echo $conn . " rollback\n\n";
-}
-
-function select_data($conn) 
-{
-  $stmt = ociparse($conn, "select * from scott.hallo");
-  ociexecute($stmt, OCI_DEFAULT);
-  echo $conn . "----selecting\n\n";
-  while (ocifetch($stmt)) {
-    echo $conn . " <" . ociresult($stmt, "TEST") . ">\n\n";
-  }
-  echo $conn . "----done\n\n";
-}
-
-create_table($c1);
-insert_data($c1);
-
-select_data($c1);   
-select_data($c2);   
-
-rollback($c1);      
-
-select_data($c1);   
-select_data($c2);   
-
-insert_data($c2);   
-commit($c2);        
-
-select_data($c1);   
-
-delete_data($c1);   
-select_data($c1);   
-select_data($c2);   
-commit($c1);        
-
-select_data($c1);
-select_data($c2);
-
-drop_table($c1);
-echo "
"; -?> -]]> -
-
-
- - - This function was renamed to oci_new_connect - after PHP >= 5.0.0. For downward compatibility - ocinlogon can also be used. - This is deprecated, however. - - -
-
+ + &reftitle.description; + + &info.function.alias; + oci_new_connect. + + +
- + + + ocinumcols + &Alias; oci_num_fields + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocinumcols - - Return the number of result columns in a statement - - - - Description - - intocinumcols - resourcestmt - - - ocinumcols returns the number of columns in the - statement stmt. - - - - <function>ocinumcols</function> example - -\n"; - $conn = OCILogon("scott", "tiger"); - $stmt = OCIParse($conn, "select * from emp"); - OCIExecute($stmt); - while (OCIFetch($stmt)) { - echo "\n"; - $ncols = OCINumCols($stmt); - for ($i = 1; $i <= $ncols; $i++) { - $column_name = OCIColumnName($stmt, $i); - $column_value = OCIResult($stmt, $i); - echo $column_name . ': ' . $column_value . "\n"; - } - echo "\n"; - } - OCIFreeStatement($stmt); - OCILogoff($conn); - echo ""; -?> -]]> - - - - - - This function was renamed to oci_num_fields - after PHP >= 5.0.0. For downward compatibility - ocinumcols can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_num_fields. + + + - + + + ociparse + &Alias; oci_parse + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociparse - Parse a query and return an Oracle statement - - - Description - - resourceociparse - resourceconn - stringquery - - - ociparse parses the - query using conn. - It returns the statement identity if the query - is valid, &false; if - not. The query can be any valid SQL - statement or PL/SQL block. - - - - This function was renamed to oci_parse - after PHP >= 5.0.0. For downward compatibility - ociparse can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_parse. + + + - + + + ociplogon + &Alias; oci_pconnect + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociplogon - - Connect to an Oracle database using a persistent connection - - - - Description - - resourceociplogon - stringusername - stringpassword - stringdb - stringcharset - - - ociplogon creates a persistent connection to - an Oracle 8 database and logs on. The optional third parameter - can either contain the name of the local Oracle instance or the - name of the entry in tnsnames.ora to which you want to connect. - If the optional third parameter is not specified, PHP uses the - environment variables ORACLE_SID (Oracle instance) - or TWO_TASK - (tnsnames.ora) to determine which database to connect to. - - &oci.charset; - - - This function was renamed to oci_pconnect - after PHP >= 5.0.0. For downward compatibility - ociplogon can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_pconnect. + + + - + + + ociresult + &Alias; oci_result + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociresult - Returns column value for fetched row - - - Description - - mixedociresult - resourcestatement - mixedcol - - - ociresult returns the data for column - column in the current row (see - ocifetch). ociresult will - return everything as strings except for abstract types (ROWIDs, - LOBs and FILEs). - - - You can either use the column-number (1-Based) or the column-name, - in uppercase, for the col parameter. - - - - This function was renamed to oci_result - after PHP >= 5.0.0. For downward compatibility - ociresult can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_result. + + + - + + + ocirollback + &Alias; oci_rollback + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocirollback - Rolls back outstanding transactions - - - Description - - boolocirollback - resourceconnection - - - ocirollback rolls back all outstanding - statements for Oracle connection connection. - &return.success; - - - - This function was renamed to oci_rollback - after PHP >= 5.0.0. For downward compatibility - ocirollback can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_rollback. + + + - + + + ocirowcount + &Alias; oci_num_rows + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocirowcount - Gets the number of affected rows - - - Description - - intocirowcount - resourcestmt - - - ocirowcount returns the number of rows affected - for e.g. update-statements. This function will not tell you the number - of rows that a select will return! - - - - <function>ocirowcount</function> example - -"; - $conn = OCILogon("scott", "tiger"); - $stmt = OCIParse($conn, "create table emp2 as select * from emp"); - OCIExecute($stmt); - echo OCIRowCount($stmt) . " rows inserted.
"; - OCIFreeStatement($stmt); - $stmt = OCIParse($conn, "delete from emp2"); - OCIExecute($stmt); - echo OCIRowCount($stmt) . " rows deleted.
"; - OCICommit($conn); - OCIFreeStatement($stmt); - $stmt = OCIParse($conn, "drop table emp2"); - OCIExecute($stmt); - OCIFreeStatement($stmt); - OCILogOff($conn); - echo ""; -?> -]]> -
-
-
- - - This function was renamed to oci_num_rows - after PHP >= 5.0.0. For downward compatibility - ocirowcount can also be used. - This is deprecated, however. - - -
-
+ + &reftitle.description; + + &info.function.alias; + oci_num_rows. + + +
- + + + ocisavelob + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocisavelob - Saves a large object - - - Description - - boolocisavelob - - - - - This function was renamed to oci_lob_save - after PHP >= 5.0.0. For downward compatibility - ocisavelob can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ocisavelobfile + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocisavelobfile - Saves a large object file - - - Description - - boolocisavelobfile - - - - - This function was renamed to oci_lob_import - after PHP >= 5.0.0. For downward compatibility - ocisavelobfile can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ociserverversion + &Alias; oci_server_version + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociserverversion - Return a string containing server version - information - - - Description - - stringociserverversion - resourceconn - - - - <function>ociserverversion</function> example - - -]]> - - - - - - This function was renamed to oci_server_version - after PHP >= 5.0.0. For downward compatibility - ociserverversion can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_server_version. + + + - + + + ocisetprefetch + &Alias; oci_set_prefetch + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocisetprefetch - Sets number of rows to be prefetched - - - Description - - boolocisetprefetch - resourcestmt - introws - - - Sets the number of top level rows to be prefetched to rows. - The default value for rows is 1 row. - - - - This function was renamed to oci_set_prefetch - after PHP >= 5.0.0. For downward compatibility - ocisetprefetch can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_set_prefetch. + + + - + + + ocistatementtype + &Alias; oci_statement_type + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ocistatementtype - Return the type of an OCI statement - - - Description - - stringocistatementtype - resourcestmt - - - ocistatementtype returns one of the following - values: - - SELECT - UPDATE - DELETE - INSERT - CREATE - DROP - ALTER - BEGIN - DECLARE - UNKNOWN - - - - <function>ocistatementtype</function> examples - -"); - } - - OCILogoff($conn); -?> -]]> - - - - - - This function was renamed to oci_statement_type - after PHP >= 5.0.0. For downward compatibility - ocistatementtype can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + oci_statement_type. + + + - + + + ociwritelobtofile + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociwritelobtofile - Saves a large object file - - - Description - - boolociwritelobtofile - stringfilename - intstart - intlength - - - - This function was renamed to oci_lob_export - after PHP >= 5.0.0. For downward compatibility - ociwritelobtofile can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + - + + + ociwritetemporarylob + &Alias; + -DO NOT TRANSLATE THIS FILE. -THE FUNCTION IT DESCRIBES WAS RENAMED AND THIS NAME IS DEPRECATED. -PLEASE, TRANSLATE THE APPROPRIATE NEW FILE. - ---> - - - - ociwritetemporarylob - Writes temporary blob - - - Description - - boolociwritetemporarylob - stringvar - intlob_type - - - - This function was renamed to oci_lob_write_temporary - after PHP >= 5.0.0. For downward compatibility - ociwritetemporarylob can also be used. - This is deprecated, however. - - - - + + &reftitle.description; + + &info.function.alias; + . + + + +
+ &reftitle.runtime; + &extension.runtime; + + + OCI8 Configuration Options + + + + Name + Default + Changeable + Changelog + + + + + oci8.privileged_connect + "0" + PHP_INI_SYSTEM + Became available in oci8 module version 1.1 + + + oci8.max_persistent + "-1" + PHP_INI_SYSTEM + Became available in oci8 module version 1.1 + + + oci8.persistent_timeout + "-1" + PHP_INI_SYSTEM + Became available in oci8 module version 1.1 + + + oci8.ping_interval + "60" + PHP_INI_SYSTEM + Became available in oci8 module version 1.1 + + + oci8.statement_cache_size + "20" + PHP_INI_SYSTEM + Became available in oci8 module version 1.1 + + + oci8.default_prefetch + "10" + PHP_INI_SYSTEM + Became available in oci8 module version 1.1 + + + oci8.old_oci_close_semantics + "0" + PHP_INI_SYSTEM + Became available in oci8 module version 1.1 + + + +
+
+ + &ini.descriptions.title; + + + + + + oci8.privileged_connect + boolean + + + + This option enables privileged connections using external credentials + (OCI_SYSOPER, OCI_SYSDBA). + + + + + + oci8.max_persistent + int + + + + The maximum number of persistent OCI8 connections per process. + Setting this option to -1 means that there is no limit. + + + + + + oci8.persistent_timeout + int + + + + The maximum length of time (in seconds) that a given process is + allowed to maintain an idle persistent connection. + Setting this option to -1 means that idle persistent connections will + be maintained forever. + + + + + + oci8.ping_interval + int + + + + The length of time (in seconds) that must pass before issuing a ping + during oci_pconnect. When set to 0, persistent + connections will be pinged every time they are reused. To disable + pings completely, set this option to -1. + + + + Disabling pings will cause oci_pconnect calls to operate at the + highest efficiency, but may cause PHP to not detect faulty connections, + such as those caused by network partitions, or if the Oracle server has + gone down since PHP connected, until later in the script. Consult the + oci_pconnect documentation for more information. + + + + + + + oci8.statement_cache_size + int + + + + This option enables statement caching, and specifies how many + statements to cache. To disable statement caching just set this option to 0. + + + + A larger cache can result in improved performance, at the cost of + increased memory usage. + + + + + + + oci8.default_prefetch + int + + + + This option enables statement prefetching and sets the default number + of rows that will be fetched automatically after statement execution. + + + + A larger prefetch can result in improved performance, at the cost of + increased memory usage. + + + + + + + oci8.old_oci_close_semantics + boolean + + + + This option controls oci_close behaviour. + Enabling it means that oci_close will do + nothing; the connection will not be + closed until the end of the script. This is for backward + compatibility only. If you find that you need to enable this + setting, you are strongly encouraged to + remove the oci_close calls from your + application instead of enabling this option. + + + + + +
+ + + + diff --git a/reference/oci8/reference.xml b/reference/oci8/reference.xml index d1efb87acc..7f9321910c 100644 --- a/reference/oci8/reference.xml +++ b/reference/oci8/reference.xml @@ -1,31 +1,21 @@ - - - - + - Oracle 8 functions + Oracle functions OCI8
&reftitle.intro; - These functions allow you to access Oracle9, Oracle8 and Oracle7 databases. - It uses the Oracle Call Interface (OCI). - - - This extension is more flexible than the - old Oracle - extension. It supports binding of global and local PHP variables - to Oracle placeholders, has full LOB, FILE and ROWID support - and allows you to use user-supplied define variables. - You are recommended to use this extension instead of - old Oracle extension where - possible. + These functions allow you to access Oracle 10, Oracle 9, Oracle 8 and + Oracle 7 databases using the Oracle Call Interface (OCI). They + support binding of PHP variables to Oracle placeholders, have full + LOB, FILE and ROWID support, and allow you to use user-supplied + define variables.
- +
&reftitle.required; @@ -33,11 +23,19 @@ Windows users will need at least Oracle version 8.1 to use the php_oci8.dll dll. + + The most convenient way to install all the required files + is to use Oracle Instant Client, which is available from here: + &url.oracle.instant.client;. + Instant Client does not need ORACLE_SID or ORACLE_HOME environment + variables set. You still may need to set LD_LIBRARY_PATH and NLS_LANG, though. + Before using this extension, make sure that you have set up your Oracle environment variables properly for the Oracle user, as well - as your web daemon user. The variables you might need to set are as - follows: + as your web daemon user. These variables should be set up + before you start your web-server. The + variables you might need to set are as follows: @@ -64,12 +62,11 @@ NLS_LANG - - - ORA_NLS33 - - + For less frequently used Oracle environment variables such as + TNS_ADMIN, TWO_TASK, ORA_TZFILE, and the various Oracle + globalization settings like ORA_NLS33, ORA_NLS10 and the NLS_* + variables refer to Oracle documentation. After setting up the environment variables for your webserver user, @@ -113,56 +110,142 @@ - Please note that on some systems like UnixWare it is libthread + Please note that on some systems, like UnixWare it is libthread instead of libpthread. PHP and Apache have to be configured with EXTRA_LIBS=-lthread.
- &reference.oci8.configure; - -
- &reftitle.runtime; - &no.config; -
- -
- &reftitle.resources; - - -
- + &reference.oci8.ini; + &reference.oci8.constants;
- &reftitle.examples; + &reftitle.examples; + + + Basic query + +'; + while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) { + print ''; + foreach ($row as $item) { + print ''.($item?htmlentities($item):' ').''; + } + print ''; + } + print ''; + + oci_close($conn); +?> +]]> + + + + + + Insert with bind variables + + +]]> + + + + + - OCI Hints + Inserting data into a CLOB column load(); +$mykey = 12343; // arbitrary key for this example; -// For INSERT or UPDATE statement use: +$sql = "INSERT INTO mytable (mykey, myclob) + VALUES (:mykey, EMPTY_CLOB()) + RETURNING myclob INTO :myclob"; -$sql = "insert into table (field1, field2) values (field1 = 'value', - field2 = empty_clob()) returning field2 into :field2"; -OCIParse($conn, $sql); -$clob = OCINewDescriptor($conn, OCI_D_LOB); -OCIBindByName($stmt, ":field2", &$clob, -1, OCI_B_CLOB); -OCIExecute($stmt, OCI_DEFAULT); -$clob->save("some text"); -OCICommit($conn); +$stid = oci_parse($conn, $sql); +$clob = oci_new_descriptor($conn, OCI_D_LOB); +oci_bind_by_name($stid, ":mykey", $mykey, 5); +oci_bind_by_name($stid, ":myclob", $clob, -1, OCI_B_CLOB); +oci_execute($stid, OCI_DEFAULT); +$clob->save("A very long string"); + +oci_commit($conn); + +// Fetching CLOB data + +$query = 'SELECT myclob FROM mytable WHERE mykey = :mykey'; + +$stid = oci_parse ($conn, $query); +oci_bind_by_name($stid, ":mykey", $mykey, 5); +oci_execute($stid, OCI_DEFAULT); + +print ''; +while ($row = oci_fetch_array($stid, OCI_ASSOC)) { + $result = $row['MYCLOB']->load(); + print ''; +} +print '
'.$result.'
'; ?> ]]> @@ -171,14 +254,14 @@ OCICommit($conn);
You can easily access stored procedures in the same way as you - would from the commands line. + would from the command line. Using Stored Procedures ]]> @@ -197,6 +280,172 @@ $sth = OCIParse($dbh, "begin sp_newaddress( :address_id, '$firstname',
+
+ Connecting Handling + + The oci8 extension provides you with 3 different functions for + connecting to Oracle. It is up to you to use the most appropriate + function for your application, and the information in this section is + intended to help you make an informed choice. + + + Connecting to an Oracle server is a reasonably expensive operation, in + terms of the time that it takes to complete. The oci_pconnect + function uses a persistent cache of connections that can be re-used + across different script requests. This means that you will typically + only incur the connection overhead once per php process (or apache child). + + + If your application connects to Oracle using a different set of + credentials for each web user, the persistent cache employed by + oci_pconnect will become less useful as the + number of concurrent users increases, to the point where it may + start to adversely affect the overall performance of your Oracle + server due to maintaining too many idle connections. If your + application is structured in this way, it is recommended that + you either tune your application using the oci8.max_persistent and oci8.persistent_timeout + configuration settings (these will give you control over the + persistent connection cache size and lifetime) or use + oci_connect instead. + + + Both oci_connect and oci_pconnect + employ a connection cache; if you make multiple calls to + oci_connect, using the same parameters, in a + given script, the second and subsequent calls return return the existing + connection handle. The cache used by oci_connect + is cleaned up at the end of the script run, or when you explicitly close + the connection handle. oci_pconnect has similar + behaviour, although its cache is maintained separately and survives + between requests. + + + This caching feature is important to remember, because it gives the + appearance that the two handles are not transactionally isolated (they + are in fact the same connection handle, so there is no isolation of any + kind). If your application needs two separate, transactionally isolated + connections, you should use oci_new_connect. + + + oci_new_connect always creates a new connection to + the Oracle server, regardless of what other connections might already exist. + High traffic web applications should try to avoid using + oci_new_connect, especially in the busiest sections of + the application. + +
+ +
+ Datatypes supported by the driver + + The driver supports the following types when binding parameters using + <function>oci_bind_by_name</function> function: + + + + Type + Mapping + + + + + SQLT_NTY + Maps a native collection type from a PHP collection object, + such as those created by oci_new_collection. + + + SQLT_BFILEE + Maps a native descriptor, such as those created by + oci_new_descriptor. + + + SQLT_CFILEE + Maps a native descriptor, such as those created by + oci_new_descriptor. + + + SQLT_CLOB + Maps a native descriptor, such as those created by + oci_new_descriptor. + + + SQLT_BLOB + Maps a native descriptor, such as those created by + oci_new_descriptor. + + + SQLT_RDD + Maps a native descriptor, such as those created by + oci_new_descriptor. + + + SQLT_NUM + Converts the PHP parameter to a 'C' long type, and binds to + that value. + + + SQLT_RSET + Maps a native statement handle, such as those created by + oci_parse or those retrieved from other OCI queries. + + + SQLT_CHR and any other type + Converts the PHP parameter to a string type and binds as a + string. + + + +
+ + + The following types are supported when retrieving columns from a result set: + + + + Type + Mapping + + + + + SQLT_RSET + Creates an oci statement resource to represent the the cursor. + + + SQLT_RDD + Creates a ROWID object. + + + SQLT_BLOB + Creates a LOB object. + + + SQLT_CLOB + Creates a LOB object. + + + SQLT_BFILE + Creates a LOB object. + + + SQLT_LNG + Bound as SQLT_CHR, returned as a string + + + SQLT_LBI + Bound as SQLT_BIN, returned as a string + + + Any other type + Bound as SQLT_CHR, returned as a string + + + +
+
+
&reference.oci8.functions; @@ -223,3 +472,4 @@ vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> +