From b9e9eeb471810a909ad84ca3c3a66f3e4de1b0d2 Mon Sep 17 00:00:00 2001 From: Ron Chmara Date: Sun, 5 Nov 2000 06:40:30 +0000 Subject: [PATCH] Typos, indentation, line breaks, reordering function listing, updating some text. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@35288 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/oci8.xml | 527 ++++++++++++++++++++++++--------------------- 1 file changed, 276 insertions(+), 251 deletions(-) diff --git a/functions/oci8.xml b/functions/oci8.xml index 2128869b91..1d4e0be49f 100644 --- a/functions/oci8.xml +++ b/functions/oci8.xml @@ -71,7 +71,7 @@ OCIExecute($stmt, OCI_DEFAULT); $result = OCIResult($stmt, $n); if (is_object ($result)) $result = $result->load(); -// For INSERT or UPDATE statetment use: +// For INSERT or UPDATE statement use: $sql = "insert into table (field1, field2) values (field1 = 'value', field2 = empty_clob()) returning field2 into :field2"; @@ -110,37 +110,6 @@ $sth = OCIParse ( $dbh, "begin sp_newaddress( :address_id, '$firstname', - - @@ -156,8 +125,9 @@ OCIFreeCursor int OCIDefineByName int stmt string Column-Name - mixed &variable - int type + mixed variable + int type + @@ -187,8 +157,8 @@ $stmt = OCIParse($conn,"select empno, ename from emp"); /* the define MUST be done BEFORE ociexecute! */ -OCIDefineByName($stmt,"EMPNO",&$empno); -OCIDefineByName($stmt,"ENAME",&$ename); +OCIDefineByName($stmt,"EMPNO",$empno); +OCIDefineByName($stmt,"ENAME",$ename); OCIExecute($stmt); @@ -208,7 +178,9 @@ OCILogoff($conn); OCIBindByName - Bind a PHP variable to an Oracle Placeholder + + Bind a PHP variable to an Oracle Placeholder + Description @@ -218,8 +190,9 @@ OCILogoff($conn); int stmt string ph_name mixed &variable - intlength - int type + int length + int + type @@ -228,7 +201,7 @@ OCILogoff($conn); 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 paramter sets the maximum length + 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. @@ -249,7 +222,7 @@ OCILogoff($conn); <?php /* OCIBindByPos example thies@thieso.net (980221) - inserts 3 resords into emp, and uses the ROWID for updating the + inserts 3 records into emp, and uses the ROWID for updating the records just after the insert. */ @@ -302,11 +275,11 @@ OCILogoff($conn); It is a bad idea to use magic quotes and - OciBindByName simultaneously as no qouting + 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. + will be written into your database as + OciBindByName is not able to distinguish + magically added quotings from those added by intention. @@ -324,7 +297,9 @@ OCILogoff($conn); int OCILogon string username string password - string db + string + db + @@ -380,7 +355,7 @@ function delete_data($conn) function commit($conn) { ocicommit($conn); - echo $conn." commited\n\n"; + echo $conn." committed\n\n"; } function rollback($conn) @@ -435,8 +410,8 @@ print "</PRE></HTML>"; OCIPLogon - Connect to an Oracle database and log on using a persistant connection. - Returns a new session. + Connect to an Oracle database and log on using a + persistant connection. Returns a new session. Description @@ -445,7 +420,9 @@ print "</PRE></HTML>"; int OCIPLogon string username string password - string db + string + db + @@ -459,14 +436,16 @@ print "</PRE></HTML>"; See also OCILogon and - OCINLogon. - + OCINLogon. + + + OCINLogon - Connect to an Oracle database and log on using a new connection. - Returns a new session. + Connect to an Oracle database and log on using a new + connection. Returns a new session. Description @@ -475,7 +454,9 @@ print "</PRE></HTML>"; int OCINLogon string username string password - string db + string + db + @@ -536,7 +517,7 @@ function delete_data($conn) function commit($conn) { ocicommit($conn); - echo $conn." commited\n\n"; + echo $conn." committed\n\n"; } function rollback($conn) @@ -580,11 +561,14 @@ select_data($c2); drop_table($c1); print "</PRE></HTML>"; -?> +?> + See also OCILogon and - OCIPLogon. - + OCIPLogon. + + + @@ -616,15 +600,18 @@ print "</PRE></HTML>"; int OCIExecute int statement - int mode + int + mode + - 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 commited automaticly specify OCI_DEFAULT as - your mode. + 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 automaticly specify OCI_DEFAULT as + your mode. @@ -643,8 +630,8 @@ print "</PRE></HTML>"; - OCICommit commits all outstanding statements for - Oracle connection connection. + OCICommit commits all outstanding statements + for Oracle connection connection. @@ -663,8 +650,8 @@ print "</PRE></HTML>"; - OCIRollback rolls back all outstanding statements for - Oracle connection connection. + OCIRollback rolls back all outstanding + statements for Oracle connection connection. @@ -672,7 +659,9 @@ print "</PRE></HTML>"; OCINewDescriptor - Initialize a new empty descriptor LOB/FILE (LOB is default) + + Initialize a new empty descriptor LOB/FILE (LOB is default) + Description @@ -680,16 +669,18 @@ print "</PRE></HTML>"; string OCINewDescriptor int connection - int type + int + type + OCINewDescriptor Allocates storage to hold descriptors or LOB locators. Valid values for the valid type are OCI_D_FILE, OCI_D_LOB, OCI_D_ROWID. - For LOB desriptors, the methods load, save, and savefile are - associated with the descriptor, for BFILE only the load method exists. - See the second example usage hints. + 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. OCINewDescriptor @@ -776,7 +767,7 @@ Upload file: <input type="file" name="lob_upload"><br> OCIRowCount returns the number of rows affected - for eg update-statements. This funtions will not tell you the number + for eg update-statements. This function will not tell you the number of rows that a select will return! @@ -799,15 +790,17 @@ Upload file: <input type="file" name="lob_upload"><br> OCIFreeStatement($stmt); OCILogOff($conn); print "</PRE></HTML>"; -?> - +?> + OCINumCols - Return the number of result columns in a statement + + Return the number of result columns in a statement + Description @@ -852,7 +845,7 @@ Upload file: <input type="file" name="lob_upload"><br> OCIResult - Returns coulumn value for fetched row + Returns column value for fetched row Description @@ -867,7 +860,8 @@ Upload file: <input type="file" name="lob_upload"><br> 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). + return everything as strings except for abstract types (ROWIDs, + LOBs and FILEs). @@ -886,8 +880,8 @@ Upload file: <input type="file" name="lob_upload"><br> - OCIFetch fetches the next row (for SELECT statements) - into the internal result-buffer. + OCIFetch fetches the next row (for SELECT + statements) into the internal result-buffer. @@ -904,31 +898,40 @@ Upload file: <input type="file" name="lob_upload"><br> int OCIFetchInto int stmt array &result - int mode + int + mode + - OCIFetchInto fetches the next row (for SELECT statements) - into the result array. OCIFetchInto - will overwrite the previous content of result. By default - result will contain a one-based array of all columns - that are not NULL. + OCIFetchInto fetches the next row (for SELECT + statements) into the result array. + OCIFetchInto will overwrite the previous + content of result. By default + result will contain a one-based array of all + columns that are not NULL. - The mode parameter allows you to change the default - behaviour. You can specify more than one flag by simply addig them up - (eg OCI_ASSOC+OCI_RETURN_NULLS). The known flags are: - + The mode parameter allows you to change the + default behaviour. You can specify more than one flag by simply + adding them up (eg OCI_ASSOC+OCI_RETURN_NULLS). The known flags + are: - OCI_ASSOC Return an associative array. - OCI_NUM Return an numbered array - starting with one. (DEFAULT) - OCI_RETURN_NULLS Return empty columns. - OCI_RETURN_LOBS Return the value of a LOB instead of the desxriptor. + + OCI_ASSOC Return an associative array. + + + OCI_NUM Return an numbered array starting with + one. (DEFAULT) + + + OCI_RETURN_NULLS Return empty columns. + + + OCI_RETURN_LOBS Return the value of a LOB + instead of the descriptor. + - - - @@ -949,8 +952,9 @@ Upload file: <input type="file" name="lob_upload"><br> OCIFetchStatement fetches all the rows from a - result into a user-defined array. OCIFetchStatement - returns the number of rows fetched. + result into a user-defined array. + OCIFetchStatement returns the number of rows + fetched. OCIFetchStatement @@ -990,11 +994,12 @@ print "$nrows Records Selected<BR>\n"; OCIFreeStatement($stmt); OCILogoff($conn); - -?> - +?> + + + OCIColumnIsNULL @@ -1013,12 +1018,71 @@ OCILogoff($conn); 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 for the col - parameter. + the column-number (1-Based) or the column-name for the + col parameter. + + + OCIColumnName + Returns the name of a column. + + + Description + + + string OCIColumnName + int stmt + int col + + + + OCIColumnName returns the name of the column + corresponding to the column number (1-based) that is passed in. + + + + OCIColumnName + +<?php + print "<HTML><PRE>\n"; + $conn = OCILogon("scott", "tiger"); + $stmt = OCIParse($conn,"select * from emp"); + OCIExecute($stmt); + print "<TABLE BORDER=\"1\">"; + print "<TR>"; + print "<TH>Name</TH>"; + print "<TH>Type</TH>"; + print "<TH>Length</TH>"; + print "</TR>"; + $ncols = OCINumCols($stmt); + for ( $i = 1; $i <= $ncols; $i++ ) { + $column_name = OCIColumnName($stmt,$i); + $column_type = OCIColumnType($stmt,$i); + $column_size = OCIColumnSize($stmt,$i); + print "<TR>"; + print "<TD>$column_name</TD>"; + print "<TD>$column_type</TD>"; + print "<TD>$column_size</TD>"; + print "</TR>"; + } + OCIFreeStatement($stmt); + OCILogoff($conn); + print "</PRE>"; + print "</HTML>\n"; +?> + + + + + See also OCINumCols, + OCIColumnType, + and OCIColumnSize. + + + @@ -1037,8 +1101,8 @@ OCILogoff($conn); 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 col - parameter. + the column-number (1-Based) or the column-name for the + col parameter. @@ -1076,15 +1140,79 @@ OCILogoff($conn); - See also OCINumCols, OCIColumnName, - and OCIColumnSize. + See also OCINumCols, + OCIColumnName, and + OCIColumnSize. + + + + + + + OCIColumnType + Returns the data type of a column. + + + Description + + + mixed OCIColumnType + int stmt + int col + + + + OCIColumnType returns the data type of the + column corresponding to the column number (1-based) that is passed + in. + + + + OCIColumnType + +<?php + print "<HTML><PRE>\n"; + $conn = OCILogon("scott", "tiger"); + $stmt = OCIParse($conn,"select * from emp"); + OCIExecute($stmt); + print "<TABLE BORDER=\"1\">"; + print "<TR>"; + print "<TH>Name</TH>"; + print "<TH>Type</TH>"; + print "<TH>Length</TH>"; + print "</TR>"; + $ncols = OCINumCols($stmt); + for ( $i = 1; $i <= $ncols; $i++ ) { + $column_name = OCIColumnName($stmt,$i); + $column_type = OCIColumnType($stmt,$i); + $column_size = OCIColumnSize($stmt,$i); + print "<TR>"; + print "<TD>$column_name</TD>"; + print "<TD>$column_type</TD>"; + print "<TD>$column_size</TD>"; + print "</TR>"; + } + OCIFreeStatement($stmt); + OCILogoff($conn); + print "</PRE>"; + print "</HTML>\n"; +?> + + + + + See also OCINumCols, + OCIColumnName, + and OCIColumnSize. + OCIServerVersion - Return a string containing server version information. + Return a string containing server version + information. Description @@ -1102,8 +1230,10 @@ OCILogoff($conn); $conn = OCILogon("scott","tiger"); print "Server Version: " . OCIServerVersion($conn); OCILogOff($conn); -?> - +?> + + + @@ -1121,7 +1251,8 @@ OCILogoff($conn); - OCIStatementType returns on of the following values: + OCIStatementType returns one of the following + values: "SELECT" "UPDATE" @@ -1151,15 +1282,18 @@ OCILogoff($conn); OCILogoff($conn); print "</PRE></HTML>"; ?> - - + + + OCINewCursor - return a new cursor (Statement-Handle) - use this to bind ref-cursors! + + Return a new cursor (Statement-Handle) - use to bind ref-cursors. + Description @@ -1170,8 +1304,8 @@ OCILogoff($conn); - OCINewCursor allocates a new statement handle on the specified - connection. + OCINewCursor allocates a new statement handle + on the specified connection. @@ -1245,7 +1379,9 @@ OCILogoff($conn); OCIFreeStatement - Free all resources associated with a statement. + + Free all resources associated with a statement. + Description @@ -1256,8 +1392,8 @@ OCILogoff($conn); - OCIFreeStatement returns true if successful, or false if - unsuccessful. + OCIFreeStatement returns true if successful, + or false if unsuccessful. @@ -1265,7 +1401,9 @@ OCILogoff($conn); OCIFreeCursor - Free all resources associated with a cursor. + + Free all resources associated with a cursor. + Description @@ -1276,8 +1414,8 @@ OCILogoff($conn); - OCIFreeCursor returns true if successful, or false if - unsuccessful. + OCIFreeCursor returns true if successful, or + false if unsuccessful. @@ -1296,128 +1434,12 @@ OCILogoff($conn); - OCIFreeDesc returns true if successful, or false if - unsuccessful. + OCIFreeDesc returns true if successful, or + false if unsuccessful. - - - - OCIColumnName - Returns the name of a column. - - - Description - - - string OCIColumnName - int stmt - int col - - - - OCIColumnName returns the name of the column - corresponding to the column number (1-based) that is passed in. - - - - OCIColumnName - -<?php - print "<HTML><PRE>\n"; - $conn = OCILogon("scott", "tiger"); - $stmt = OCIParse($conn,"select * from emp"); - OCIExecute($stmt); - print "<TABLE BORDER=\"1\">"; - print "<TR>"; - print "<TH>Name</TH>"; - print "<TH>Type</TH>"; - print "<TH>Length</TH>"; - print "</TR>"; - $ncols = OCINumCols($stmt); - for ( $i = 1; $i <= $ncols; $i++ ) { - $column_name = OCIColumnName($stmt,$i); - $column_type = OCIColumnType($stmt,$i); - $column_size = OCIColumnSize($stmt,$i); - print "<TR>"; - print "<TD>$column_name</TD>"; - print "<TD>$column_type</TD>"; - print "<TD>$column_size</TD>"; - print "</TR>"; - } - OCIFreeStatement($stmt); - OCILogoff($conn); - print "</PRE>"; - print "</HTML>\n"; -?> - - - - - See also OCINumCols, OCIColumnType, - and OCIColumnSize. - - - - - - OCIColumnType - Returns the data type of a column. - - - Description - - - mixed OCIColumnType - int stmt - int col - - - - OCIColumnType returns the data type of the column - corresponding to the column number (1-based) that is passed in. - - - - OCIColumnType - -<?php - print "<HTML><PRE>\n"; - $conn = OCILogon("scott", "tiger"); - $stmt = OCIParse($conn,"select * from emp"); - OCIExecute($stmt); - print "<TABLE BORDER=\"1\">"; - print "<TR>"; - print "<TH>Name</TH>"; - print "<TH>Type</TH>"; - print "<TH>Length</TH>"; - print "</TR>"; - $ncols = OCINumCols($stmt); - for ( $i = 1; $i <= $ncols; $i++ ) { - $column_name = OCIColumnName($stmt,$i); - $column_type = OCIColumnType($stmt,$i); - $column_size = OCIColumnSize($stmt,$i); - print "<TR>"; - print "<TD>$column_name</TD>"; - print "<TD>$column_type</TD>"; - print "<TD>$column_size</TD>"; - print "</TR>"; - } - OCIFreeStatement($stmt); - OCILogoff($conn); - print "</PRE>"; - print "</HTML>\n"; -?> - - - - - See also OCINumCols, OCIColumnName, - and OCIColumnSize. - - - + OCIParse @@ -1433,10 +1455,11 @@ OCILogoff($conn); - 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. + 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. @@ -1487,8 +1510,10 @@ OCILogoff($conn); - OCIInternalDebug enables internal debug output. Set onoff - to 0 to turn debug output off, 1 to turn it on. + OCIInternalDebug enables internal debug + output. Set onoff to 0 to turn debug + output off, 1 to turn it on. +