mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 17:08:54 +00:00
Updating/adding functions
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@30949 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
43077fbc6a
commit
53a06e022f
1 changed files with 241 additions and 81 deletions
|
@ -23,24 +23,23 @@
|
|||
Returns true if the bind succeeds, otherwise false. Details
|
||||
about the error can be retrieved using the
|
||||
<function>ora_error</function> and
|
||||
<function>ora_errorcode</function> functions.</para>
|
||||
|
||||
<function>ora_errorcode</function> functions.
|
||||
</para>
|
||||
<para>
|
||||
This function binds the named PHP variable with a SQL parameter.
|
||||
The SQL parameter must be in the form ":name". With the optional
|
||||
type parameter, you can define whether the SQL parameter is an
|
||||
in/out (0, default), in (1) or out (2) parameter. As of PHP
|
||||
3.0.1, you can use the constants ORA_BIND_INOUT, ORA_BIND_IN and
|
||||
ORA_BIND_OUT instead of the numbers.</para>
|
||||
|
||||
ORA_BIND_OUT instead of the numbers.
|
||||
</para>
|
||||
<para>
|
||||
ora_bind must be called after <function>ora_parse</function> and
|
||||
before <function>ora_exec</function>. Input values can be given
|
||||
by assignment to the bound PHP variables, after calling
|
||||
<function>ora_exec</function> the bound PHP variables contain the output
|
||||
values if available.
|
||||
|
||||
<informalexample>
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
ora_parse($curs, "declare tmp INTEGER; begin tmp := :in; :out := tmp; :x := 7.77; end;");
|
||||
|
@ -51,9 +50,9 @@ $input = 765;
|
|||
ora_exec($curs);
|
||||
echo "Result: $result<BR>Out: $output<BR>In: $input";
|
||||
?>
|
||||
</programlisting>
|
||||
</informalexample></para>
|
||||
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
@ -74,16 +73,15 @@ echo "Result: $result<BR>Out: $output<BR>In: $input";
|
|||
Returns true if the close succeeds, otherwise false. Details
|
||||
about the error can be retrieved using the
|
||||
<function>ora_error</function> and
|
||||
<function>ora_errorcode</function> functions.</para>
|
||||
|
||||
<function>ora_errorcode</function> functions.
|
||||
</para>
|
||||
<para>
|
||||
This function closes a data cursor opened with
|
||||
<function>ora_open</function>.</para>
|
||||
|
||||
<function>ora_open</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-columnname">
|
||||
<refnamediv>
|
||||
<refname>Ora_ColumnName</refname>
|
||||
|
@ -102,15 +100,38 @@ echo "Result: $result<BR>Out: $output<BR>In: $input";
|
|||
Returns the name of the field/column
|
||||
<parameter>column</parameter> on the cursor
|
||||
<parameter>cursor</parameter>. The returned name is in all
|
||||
uppercase letters.</para>
|
||||
uppercase letters.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-columntype">
|
||||
<refentry id="function.ora-columnname">
|
||||
<refnamediv>
|
||||
<refname>Ora_ColumnType</refname>
|
||||
<refpurpose>get type of Oracle result column</refpurpose>
|
||||
<refname>Ora_ColumnName</refname>
|
||||
<refpurpose>get name of Oracle result column</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>string <function>Ora_ColumnName</function></funcdef>
|
||||
<paramdef>int <parameter>cursor</parameter></paramdef>
|
||||
<paramdef>int <parameter>column</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Returns the name of the field/column
|
||||
<parameter>column</parameter> on the cursor
|
||||
<parameter>cursor</parameter>. The returned name is in all
|
||||
uppercase letters.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-columnsize">
|
||||
<refnamediv>
|
||||
<refname>Ora_ColumnSize</refname>
|
||||
<refpurpose>get size of Oracle result column</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
@ -155,16 +176,15 @@ echo "Result: $result<BR>Out: $output<BR>In: $input";
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>Returns true on success, false on error. Details about the
|
||||
error can be retrieved using the <function>ora_error</function>
|
||||
and <function>ora_errorcode</function> functions. This function
|
||||
commits an Oracle transaction. A transaction is defined as all
|
||||
the changes on a given connection since the last commit/rollback,
|
||||
autocommit was turned off or when the connection was established.</para>
|
||||
|
||||
error can be retrieved using the <function>ora_error</function>
|
||||
and <function>ora_errorcode</function> functions. This function
|
||||
commits an Oracle transaction. A transaction is defined as all
|
||||
the changes on a given connection since the last commit/rollback,
|
||||
autocommit was turned off or when the connection was established.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-commitoff">
|
||||
<refnamediv>
|
||||
<refname>Ora_CommitOff</refname>
|
||||
|
@ -181,16 +201,15 @@ echo "Result: $result<BR>Out: $output<BR>In: $input";
|
|||
<para>
|
||||
Returns true on success, false on error. Details about the error
|
||||
can be retrieved using the <function>ora_error</function> and
|
||||
<function>ora_errorcode</function> functions.</para>
|
||||
|
||||
<function>ora_errorcode</function> functions.
|
||||
</para>
|
||||
<para>
|
||||
This function turns off automatic commit after each
|
||||
<function>ora_exec</function>.</para>
|
||||
|
||||
<function>ora_exec</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-commiton">
|
||||
<refnamediv>
|
||||
<refname>Ora_CommitOn</refname>
|
||||
|
@ -206,16 +225,44 @@ echo "Result: $result<BR>Out: $output<BR>In: $input";
|
|||
</funcsynopsis>
|
||||
<para>
|
||||
This function turns on automatic commit after each
|
||||
<function>ora_exec</function> on the given connection.</para>
|
||||
|
||||
<function>ora_exec</function> on the given connection.
|
||||
</para>
|
||||
<para>
|
||||
Returns true on success, false on error. Details about the error
|
||||
can be retrieved using the <function>ora_error</function> and
|
||||
<function>ora_errorcode</function> functions.</para>
|
||||
|
||||
<function>ora_errorcode</function> functions.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-do">
|
||||
<refnamediv>
|
||||
<refname>Ora_Do</refname>
|
||||
<refpurpose>Parse, Exec, Fetch</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>ora_do</function></funcdef>
|
||||
<paramdef>int <parameter>conn</parameter></paramdef>
|
||||
<paramdef>string <parameter>query</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
This function is quick combination of <function>ora_parse</function>,
|
||||
<function>ora_exec</function> and <function>ora_fetch</function>.
|
||||
It will parse and execute a statement, then fetch the first result row.
|
||||
</para>
|
||||
<para>
|
||||
Returns true on success, false on error. Details about the error
|
||||
can be retrieved using the <function>ora_error</function> and
|
||||
<function>ora_errorcode</function> functions.
|
||||
See also <function>Ora_Parse</function>,<function>Ora_Exec</function>,
|
||||
and <function>Ora_Fetch</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-error">
|
||||
<refnamediv>
|
||||
|
@ -236,9 +283,10 @@ echo "Result: $result<BR>Out: $output<BR>In: $input";
|
|||
where <replaceable>XXX</replaceable> is where the error comes
|
||||
from and <replaceable>NNNNN</replaceable> identifies the error
|
||||
message.
|
||||
<note>
|
||||
<para>Support for connection ids was added in 3.0.4.</para>
|
||||
</note></para>
|
||||
<note>
|
||||
<para>Support for connection ids was added in 3.0.4.</para>
|
||||
</note>
|
||||
</para>
|
||||
<para>
|
||||
On UNIX versions of Oracle, you can find details about an error
|
||||
message like this: <computeroutput>
|
||||
|
@ -247,12 +295,11 @@ echo "Result: $result<BR>Out: $output<BR>In: $input";
|
|||
statement attempted to insert a duplicate key // For Trusted
|
||||
ORACLE configured in DBMS MAC mode, you may see // this message
|
||||
if a duplicate entry exists at a different level. // *Action: Either
|
||||
remove the unique restriction or do not insert the key </computeroutput></para>
|
||||
|
||||
remove the unique restriction or do not insert the key </computeroutput>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-errorcode">
|
||||
<refnamediv>
|
||||
<refname>Ora_ErrorCode</refname>
|
||||
|
@ -270,14 +317,13 @@ remove the unique restriction or do not insert the key </computeroutput></para>
|
|||
Returns the numeric error code of the last executed statement on
|
||||
the specified cursor or connection.
|
||||
<comment>FIXME: should possible values be listed?</comment>
|
||||
<note>
|
||||
<para>Support for connection ids was added in 3.0.4.</para>
|
||||
</note></para>
|
||||
|
||||
<note>
|
||||
<para>Support for connection ids was added in 3.0.4.</para>
|
||||
</note>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-exec">
|
||||
<refnamediv>
|
||||
<refname>Ora_Exec</refname>
|
||||
|
@ -294,12 +340,15 @@ remove the unique restriction or do not insert the key </computeroutput></para>
|
|||
<para>
|
||||
Returns true on success, false on error. Details about the error
|
||||
can be retrieved using the <function>ora_error</function> and
|
||||
<function>ora_errorcode</function> functions.</para>
|
||||
|
||||
<function>ora_errorcode</function> functions.
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>Ora_Parse</function>,
|
||||
<function>Ora_Fetch</function>, and <function>Ora_Do</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-fetch">
|
||||
<refnamediv>
|
||||
<refname>Ora_Fetch</refname>
|
||||
|
@ -319,11 +368,55 @@ remove the unique restriction or do not insert the key </computeroutput></para>
|
|||
using the <function>ora_error</function> and
|
||||
<function>ora_errorcode</function> functions. If there was no
|
||||
error, <function>ora_errorcode</function> will return 0.
|
||||
Retrieves a row of data from the specified cursor.</para>
|
||||
|
||||
Retrieves a row of data from the specified cursor.
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>Ora_Parse</function>,<function>Ora_Exec</function>,
|
||||
and <function>Ora_Do</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-fetchinto">
|
||||
<refnamediv>
|
||||
<refname>Ora_FetchInto</refname>
|
||||
<refpurpose>Fetch a row into the specified result array</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>ora_fetchinto</function></funcdef>
|
||||
<paramdef>int <parameter>cursor</parameter></paramdef>
|
||||
<paramdef>array <parameter>result</parameter></paramdef>
|
||||
<paramdef>int
|
||||
<parameter>
|
||||
<optional>flags</optional>
|
||||
</parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
You can fetch a row into an array with this function.
|
||||
<example>
|
||||
<title>Oracle fetch into array</title>
|
||||
<programlisting role="php">
|
||||
<?php
|
||||
array($results);
|
||||
ora_fetch_into($cursor, &$results);
|
||||
echo $results[0];
|
||||
echo $results[1];
|
||||
?>
|
||||
</programlisting>
|
||||
</example>
|
||||
Note that you need to fetch the array by reference.
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>Ora_Parse</function>,<function>Ora_Exec</function>,
|
||||
<function>Ora_Fetch</function>, and <function>Ora_Do</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-getcolumn">
|
||||
<refnamediv>
|
||||
|
@ -346,12 +439,11 @@ remove the unique restriction or do not insert the key </computeroutput></para>
|
|||
on the results from this function may be true in cases where there is
|
||||
not error as well (NULL result, empty string, the number 0, the
|
||||
string "0"). Fetches the data for a column or function
|
||||
result.</para>
|
||||
|
||||
result.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-logoff">
|
||||
<refnamediv>
|
||||
<refname>Ora_Logoff</refname>
|
||||
|
@ -369,12 +461,11 @@ remove the unique restriction or do not insert the key </computeroutput></para>
|
|||
Returns true on success, False on error. Details about the error
|
||||
can be retrieved using the <function>ora_error</function> and <function>ora_errorcode</function>
|
||||
functions. Logs out the user and disconnects from the
|
||||
server.</para>
|
||||
|
||||
server.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-logon">
|
||||
<refnamediv>
|
||||
<refname>Ora_Logon</refname>
|
||||
|
@ -391,8 +482,8 @@ remove the unique restriction or do not insert the key </computeroutput></para>
|
|||
</funcsynopsis>
|
||||
<para>
|
||||
Establishes a connection between PHP and an Oracle database with the
|
||||
given username and password.</para>
|
||||
|
||||
given username and password.
|
||||
</para>
|
||||
<para>
|
||||
Connections can be made using <productname>SQL*Net</productname>
|
||||
by supplying the <acronym>TNS</acronym> name to
|
||||
|
@ -401,22 +492,91 @@ remove the unique restriction or do not insert the key </computeroutput></para>
|
|||
<programlisting role="php">
|
||||
$conn = Ora_Logon("user<emphasis>@TNSNAME</emphasis>", "pass");
|
||||
</programlisting>
|
||||
</informalexample></para>
|
||||
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
If you have character data with non-ASCII characters, you should
|
||||
make sure that <envar>NLS_LANG</envar> is set in your
|
||||
environment. For server modules, you should set it in the
|
||||
server's environment before starting the server.</para>
|
||||
|
||||
server's environment before starting the server.
|
||||
</para>
|
||||
<para>
|
||||
Returns a connection index on success, or false on failure.
|
||||
Details about the error can be retrieved using the <function>ora_error</function> and <function>ora_errorcode</function>
|
||||
functions.</para>
|
||||
|
||||
Details about the error can be retrieved using the
|
||||
<function>ora_error</function> and <function>ora_errorcode</function>
|
||||
functions.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-plogon">
|
||||
<refnamediv>
|
||||
<refname>Ora_pLogon</refname>
|
||||
<refpurpose>
|
||||
Open a persistent Oracle connection
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>ora_logon</function></funcdef>
|
||||
<paramdef>string <parameter>user</parameter></paramdef>
|
||||
<paramdef>string <parameter>password</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Establishes a persistant connection between PHP and an Oracle database with the
|
||||
given username and password.
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>Ora_Logon</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-numcols">
|
||||
<refnamediv>
|
||||
<refname>Ora_Numcols</refname>
|
||||
<refpurpose>Returns the number of columns</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>ora_numcols</function></funcdef>
|
||||
<paramdef>int <parameter>cursor_ind</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>ora_numcols</function> returns the number of columns in a result.
|
||||
Only returns meaningful values after an parse/exec/fetch sequence.
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>Ora_Parse</function>,<function>Ora_Exec</function>,
|
||||
<function>Ora_Fetch</function>, and <function>Ora_Do</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-numrows">
|
||||
<refnamediv>
|
||||
<refname>Ora_Numrows</refname>
|
||||
<refpurpose>Returns the number of rows</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<funcsynopsis>
|
||||
<funcprototype>
|
||||
<funcdef>int <function>ora_numrows</function></funcdef>
|
||||
<paramdef>int <parameter>cursor_ind</parameter></paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
<function>ora_numcols</function> returns the number of rows in a result.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="function.ora-open">
|
||||
<refnamediv>
|
||||
|
@ -432,17 +592,16 @@ $conn = Ora_Logon("user<emphasis>@TNSNAME</emphasis>", "pass");
|
|||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
Opens an Oracle cursor associated with connection.</para>
|
||||
|
||||
Opens an Oracle cursor associated with connection.
|
||||
</para>
|
||||
<para>
|
||||
Returns a cursor index or False on failure. Details about the
|
||||
error can be retrieved using the <function>ora_error</function> and <function>ora_errorcode</function>
|
||||
functions.</para>
|
||||
|
||||
error can be retrieved using the <function>ora_error</function>
|
||||
and <function>ora_errorcode</function> functions.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-parse">
|
||||
<refnamediv>
|
||||
<refname>Ora_Parse</refname>
|
||||
|
@ -461,12 +620,15 @@ $conn = Ora_Logon("user<emphasis>@TNSNAME</emphasis>", "pass");
|
|||
<para>
|
||||
This function parses an SQL statement or a PL/SQL block and
|
||||
associates it with the given cursor. Returns 0 on success or -1 on
|
||||
error.</para>
|
||||
|
||||
error.
|
||||
</para>
|
||||
<simpara>
|
||||
See also <function>Ora_Exec</function>,
|
||||
<function>Ora_Fetch</function>, and <function>Ora_Do</function>.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<refentry id="function.ora-rollback">
|
||||
<refnamediv>
|
||||
<refname>Ora_Rollback</refname>
|
||||
|
@ -483,17 +645,15 @@ $conn = Ora_Logon("user<emphasis>@TNSNAME</emphasis>", "pass");
|
|||
<para>
|
||||
This function undoes an Oracle transaction. (See
|
||||
<function>ora_commit</function> for the definition of a
|
||||
transaction.)</para>
|
||||
|
||||
transaction.)
|
||||
</para>
|
||||
<para>
|
||||
Returns true on success, false on error. Details about the error
|
||||
can be retrieved using the <function>ora_error</function> and
|
||||
<function>ora_errorcode</function> functions.</para>
|
||||
|
||||
<function>ora_errorcode</function> functions.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
</reference>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
Loading…
Reference in a new issue