cvs: phpdoc-zh /reference/oci8/functions oci-new-collection.xml oci-new-cursor.xml oci-new-descriptor.xml ocinewcollection.xml ocinewcursor.xml
ocinewdescriptor.xml

From: Date: Thu, 08 Sep 2005 16:58:21 +0000
Subject: cvs: phpdoc-zh /reference/oci8/functions oci-new-collection.xml oci-new-cursor.xml oci-new-descriptor.xml ocinewcollection.xml ocinewcursor.xml
ocinewdescriptor.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-2618@lists.php.net to get a copy of this message
dallas Thu Sep 8 12:58:21 2005 EDT Added files: /phpdoc-zh/reference/oci8/functions oci-new-collection.xml oci-new-cursor.xml oci-new-descriptor.xml Modified files: /phpdoc-zh/reference/oci8/functions ocinewcollection.xml ocinewcursor.xml ocinewdescriptor.xml Log: Updated.

http://cvs.php.net/diff.php/phpdoc-zh/reference/oci8/functions/ocinewcollection.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc-zh/reference/oci8/functions/ocinewcollection.xml diff -u phpdoc-zh/reference/oci8/functions/ocinewcollection.xml:1.4 phpdoc-zh/reference/oci8/functions/ocinewcollection.xml:1.5 --- phpdoc-zh/reference/oci8/functions/ocinewcollection.xml:1.4 Thu Aug 18 00:41:31 2005 +++ phpdoc-zh/reference/oci8/functions/ocinewcollection.xml Thu Sep 8 12:58:21 2005 @@ -1,26 +1,20 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> -<!-- $Author: lm92 $ --> -<!-- EN-Revision: 1.4 Maintainer: yincheng Status: ready --> -<!-- splitted from ./en/functions/oci8.xml, last change in rev 1.23 --> - <refentry id="function.ocinewcollection"> - <refnamediv> - <refname>ocinewcollection</refname> - <refpurpose>¸Ãº¯ÊýĿǰÔÝʱûÓвο¼Îĵµ</refpurpose> - </refnamediv> - <refsect1> - <title>ÃèÊö</title> - <methodsynopsis> - <type>bool</type><methodname>ocinewcollection</methodname> - <methodparam><type>int</type><parameter>conn</parameter></methodparam> - <methodparam><type>string</type><parameter>tdo</parameter></methodparam> - <methodparam choice="opt"><type>string</type><parameter>shema</parameter></methodparam> - </methodsynopsis> - <para> - &warn.undocumented.func; - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.5 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.12 Maintainer: yincheng Status: ready --> +<refentry id="function.ocinewcollection"> + <refnamediv> + <refname>ocinewcollection</refname> + <refpurpose><function>oci_new_collection</function> µÄ&Alias;</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <simpara> + &info.function.alias;<function>oci_new_collection</function>¡£ + </simpara> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/oci8/functions/ocinewcursor.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/oci8/functions/ocinewcursor.xml diff -u phpdoc-zh/reference/oci8/functions/ocinewcursor.xml:1.2 phpdoc-zh/reference/oci8/functions/ocinewcursor.xml:1.3 --- phpdoc-zh/reference/oci8/functions/ocinewcursor.xml:1.2 Thu Aug 18 00:41:31 2005 +++ phpdoc-zh/reference/oci8/functions/ocinewcursor.xml Thu Sep 8 12:58:21 2005 @@ -1,96 +1,20 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: lm92 $ --> -<!-- EN-Revision: 1.6 Maintainer: yincheng Status: ready --> -<!-- splitted from ./en/functions/oci8.xml, last change in rev 1.2 --> - <refentry id="function.ocinewcursor"> - <refnamediv> - <refname>ocinewcursor</refname> - <refpurpose> -·µ»ØÒ»¸öеÄÓαê(Óï¾ä¾ä±ú) - </refpurpose> - </refnamediv> - <refsect1> - <title>ÃèÊö</title> - <methodsynopsis> - <type>resource</type><methodname>ocinewcursor</methodname> - <methodparam><type>resource</type><parameter>conn</parameter></methodparam> - </methodsynopsis> - <para> - <function>ocinewcursor</function> ÔÚÌØ¶¨µÄÁ¬½ÓÉÏ·ÖÅäÒ»¸öеÄÓï¾ä¾ä±ú¡£ - </para> - <para> - <example> - <title>´ÓÒ»¸ö Oracle µÄ´¢´æ¹ý³ÌÖÐʹÓÃÒ»¸ö REF CURSOR</title> - <programlisting role="php"> -<![CDATA[ -<?php -// suppose your stored procedure info.output returns a ref cursor in :data - -$conn = OCILogon("scott", "tiger"); -$curs = OCINewCursor($conn); -$stmt = OCIParse($conn, "begin info.output(:data); end;"); - -ocibindbyname($stmt, "data", &$curs, -1, OCI_B_CURSOR); -ociexecute($stmt); -ociexecute($curs); - -while (OCIFetchInto($curs, &$data)) { - var_dump($data); -} - -OCIFreeStatement($stmt); -OCIFreeCursor($curs); -OCILogoff($conn); -?> -]]> - </programlisting> - </example> - </para> - <para> - <example> - <title>ÔÚ Oracle µÄ select Óï¾äÖÐʹÓà REF CURSOR</title> - <programlisting role="php"> -<![CDATA[ -<?php -echo "<html><body>"; -$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 "<table border=\"1\">"; -echo "<tr>"; -echo "<th>DEPT NAME</th>"; -echo "<th>DEPT #</th>"; -echo "<th># EMPLOYEES</th>"; -echo "</tr>"; - -while (OCIFetchInto($stmt, &$data, OCI_ASSOC)) { - echo "<tr>"; - $dname = $data["DNAME"]; - $deptno = $data["DEPTNO"]; - echo "<td>$dname</td>"; - echo "<td>$deptno</td>"; - ociexecute($data["EMPCNT"]); - while (OCIFetchInto($data["EMPCNT"], &$subdata, OCI_ASSOC)) { - $num_emps = $subdata["NUM_EMPS"]; - echo "<td>$num_emps</td>"; - } - echo "</tr>"; -} -echo "</table>"; -echo "</body></html>"; -OCIFreeStatement($stmt); -OCILogoff($conn); -?> -]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.12 Maintainer: dallas Status: ready --> +<refentry id="function.ocinewcursor"> + <refnamediv> + <refname>ocinewcursor</refname> + <refpurpose><function>oci_new_cursor</function> µÄ&Alias;</refpurpose> + </refnamediv> + + <refsect1 role="description"> + &reftitle.description; + <simpara> + &info.function.alias;<function>oci_new_cursor</function>¡£ + </simpara> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-zh/reference/oci8/functions/ocinewdescriptor.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-zh/reference/oci8/functions/ocinewdescriptor.xml diff -u phpdoc-zh/reference/oci8/functions/ocinewdescriptor.xml:1.2 phpdoc-zh/reference/oci8/functions/ocinewdescriptor.xml:1.3 --- phpdoc-zh/reference/oci8/functions/ocinewdescriptor.xml:1.2 Thu Aug 18 00:41:31 2005 +++ phpdoc-zh/reference/oci8/functions/ocinewdescriptor.xml Thu Sep 8 12:58:21 2005 @@ -1,142 +1,20 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> -<!-- $Author: lm92 $ --> -<!-- EN-Revision: 1.9 Maintainer: yincheng Status: ready --> -<!-- splitted from ./en/functions/oci8.xml, last change in rev 1.2 --> - <refentry id="function.ocinewdescriptor"> - <refnamediv> - <refname>ocinewdescriptor</refname> - <refpurpose> - ³õʼ»¯Ò»¸öÐÂµÄ¿Õ LOB »ò FILE ÃèÊö·û - </refpurpose> - </refnamediv> - <refsect1> - <title>ÃèÊö</title> - <methodsynopsis> - <type>object</type><methodname>ocinewdescriptor</methodname> - <methodparam><type>resource</type><parameter>connection</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam> - </methodsynopsis> - <para> - <function>ocinewdescriptor</function> ·ÖÅä¿Õ¼ä´æ´¢ÃèÊö·û»ò -LOB ¶¨Î»Æ÷¡£ -ÓÐЧµÄ <parameter>type</parameter> ÖµÊÇ <constant>OCI_D_FILE</constant>¡¢ - <constant>OCI_D_LOB</constant> ºÍ <constant>OCI_D_ROWID</constant>¡£ -¶ÔÓÚ LOB ÃèÊö·û£¬·½·¨ load, save, ºÍ savefile ÓëÃèÊö·ûÏà¹Ø£¬¶ø - BFILE Ö»´æÔÚ load ·½·¨¡£²Î¼ûµÚ¶þ¸öÀý×ÓµÄʹÓÃÌáʾ¡£ - </para> - <para> - <example> - <title><function>ocinewdescriptor</function></title> - <programlisting role="php"> -<![CDATA[ -<?php - /* This script is designed to be called from a HTML form. - * It expects $user, $password, $table, $where, and $commitsize - * to be passed in from the form. The script then deletes - * the selected rows using the ROWID and commits after each - * set of $commitsize rows. (Use with care, there is no rollback) - */ - $conn = OCILogon($user, $password); - $stmt = OCIParse($conn, "select rowid from $table $where"); - $rowid = OCINewDescriptor($conn, OCI_D_ROWID); - OCIDefineByName($stmt, "ROWID", &$rowid); - OCIExecute($stmt); - while (OCIFetch($stmt)) { - $nrows = OCIRowCount($stmt); - $delete = OCIParse($conn, "delete from $table where ROWID = :rid"); - OCIBindByName($delete, ":rid", &$rowid, -1, OCI_B_ROWID); - OCIExecute($delete); - echo "$nrows\n"; - if (($nrows % $commitsize) == 0) { - OCICommit($conn); - } - } - $nrows = OCIRowCount($stmt); - echo "$nrows deleted...\n"; - OCIFreeStatement($stmt); - OCILogoff($conn); -?> -]]> - </programlisting> - <programlisting role="php"> -<![CDATA[ -<?php - /* This script demonstrates file upload to LOB columns - * The formfield used for this example looks like this - * <form action="upload.php" method="post" enctype="multipart/form-data"> - * <input type="file" name="lob_upload" /> - * ... - */ - if (!isset($lob_upload) || $lob_upload == 'none'){ -?> -<form action="upload.php" method="post" enctype="multipart/form-data"> -Upload file: <input type="file" name="lob_upload" /><br /> -<input type="submit" value="Upload" /> - <input type="reset" value="Reset" /> -</form> -<?php - } else { +<!-- $Revision: 1.3 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.16 Maintainer: dallas Status: ready --> +<refentry id="function.ocinewscriptor"> + <refnamediv> + <refname>ocinewscriptor</refname> + <refpurpose><function>oci_new_descriptor</function> µÄ&Alias;</refpurpose> + </refnamediv> - // $lob_upload contains the temporary filename of the uploaded file - - // see also the features section on file upload, - // if you would like to use secure uploads - - $conn = OCILogon($user, $password); - $lob = OCINewDescriptor($conn, OCI_D_LOB); - $stmt = OCIParse($conn, "insert into $table (id, the_blob) - values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob"); - OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB); - OCIExecute($stmt, OCI_DEFAULT); - if ($lob->savefile($lob_upload)){ - OCICommit($conn); - echo "Blob successfully uploaded\n"; - }else{ - echo "Couldn't upload Blob\n"; - } - OCIFreeDesc($lob); - OCIFreeStatement($stmt); - OCILogoff($conn); - } -?> -]]> - </programlisting> - </example> - <example> - <title><function>ocinewdescriptor</function></title> - <programlisting role="php"> -<![CDATA[ -<?php - /* Calling PL/SQL stored procedures which contain clobs as input - * parameters (PHP 4 >= 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); -?> -]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + <refsect1 role="description"> + &reftitle.description; + <simpara> + &info.function.alias;<function>oci_new_descriptor</function>¡£ + </simpara> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/co.php/phpdoc-zh/reference/oci8/functions/oci-new-collection.xml?r=1.1&p=1 Index: phpdoc-zh/reference/oci8/functions/oci-new-collection.xml +++ phpdoc-zh/reference/oci8/functions/oci-new-collection.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.oci-new-collection"> <refnamediv> <refname>oci_new_collection</refname> <refpurpose>·ÖÅäÐ嵀 collection ¶ÔÏó</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>OCI-Collection</type><methodname>oci_new_collection</methodname> <methodparam><type>resource</type><parameter>connection</parameter></methodparam> <methodparam><type>string</type><parameter>tdo</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>schema</parameter></methodparam> </methodsynopsis> <para> ·ÖÅäÒ»¸öÐ嵀 collection ¶ÔÏó¡£<parameter>tdo</parameter> ²ÎÊýӦΪһ¸öÓÐЧµÄÃû×ÖÀàÐÍ£¨´óд£©¡£µÚÈý¸ö¿ÉÑ¡²ÎÊý <parameter>schema</parameter> Ó¦Ö¸Ïò½¨Á¢Ãû×Ö¶ÔÏóµÄ¼Ü¹¹¡£<function>oci_new_collection</function> ʹÓõ±Ç°Óû§×÷Ϊ <parameter>schema</parameter> µÄĬÈÏÖµ¡£ </para> <para> <function>oci_new_collection</function> Èç¹û³ö´í·µ»Ø &false;¡£ </para> <note> <para> ÔÚ PHP 5.0.0 ֮ǰµÄ°æ±¾±ØÐëʹÓà <function>ocinewcollection</function> Ìæ´ú±¾º¯Êý¡£¸Ãº¯ÊýÃûÈÔÈ»¿ÉÓã¬ÎªÏòϼæÈÝ×÷Ϊ <function>oci_new_collection</function> µÄ±ðÃû¡£²»¹ýÆäÒѱ»·ÏÆú£¬²»ÍƼöʹÓᣠ</para> </note> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-zh/reference/oci8/functions/oci-new-cursor.xml?r=1.1&p=1 Index: phpdoc-zh/reference/oci8/functions/oci-new-cursor.xml +++ phpdoc-zh/reference/oci8/functions/oci-new-cursor.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.5 Maintainer: yincheng Status: ready --> <!-- CREDITS: dallas --> <refentry id="function.oci-new-cursor"> <refnamediv> <refname>oci_new_cursor</refname> <refpurpose>·ÖÅä²¢·µ»ØÒ»¸öеÄÓα꣨Óï¾ä¾ä±ú£©</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>resource</type><methodname>oci_new_cursor</methodname> <methodparam><type>resource</type><parameter>connection</parameter></methodparam> </methodsynopsis> <para> <function>oci_new_cursor</function> ÔÚÖ¸¶¨µÄÁ¬½ÓÉÏ·ÖÅäÒ»¸öеÄÓï¾ä¾ä±ú¡£ </para> <para> <example> <title>ÔÚ Oracle µÄ´æ´¢¹ý³ÌÖÐʹÓà REF CURSOR</title> <programlisting role="php"> <![CDATA[ <?php // suppose your stored procedure info.output returns a ref cursor in :data $conn = oci_connect("scott", "tiger"); $curs = oci_new_cursor($conn); $stmt = oci_parse($conn, "begin info.output(:data); end;"); oci_bind_by_name($stmt, "data", $curs, -1, OCI_B_CURSOR); oci_execute($stmt); oci_execute($curs); while ($data = oci_fetch_row($curs)) { var_dump($data); } oci_free_statement($stmt); oci_free_statement($curs); oci_close($conn); ?> ]]> </programlisting> </example> </para> <para> <example> <title>ÔÚ Oracle µÄ select Óï¾äÖÐʹÓà REF CURSOR</title> <programlisting role="php"> <![CDATA[ <?php echo "<html><body>"; $conn = oci_connect("scott", "tiger"); $count_cursor = "CURSOR(select count(empno) num_emps from emp " . "where emp.deptno = dept.deptno) as EMPCNT from dept"; $stmt = oci_parse($conn, "select deptno,dname,$count_cursor"); oci_execute($stmt); echo "<table border=\"1\">"; echo "<tr>"; echo "<th>DEPT NAME</th>"; echo "<th>DEPT #</th>"; echo "<th># EMPLOYEES</th>"; echo "</tr>"; while ($data = oci_fetch_assoc($stmt)) { echo "<tr>"; $dname = $data["DNAME"]; $deptno = $data["DEPTNO"]; echo "<td>$dname</td>"; echo "<td>$deptno</td>"; oci_execute($data["EMPCNT"]); while ($subdata = oci_fetch_assoc($data["EMPCNT"])) { $num_emps = $subdata["NUM_EMPS"]; echo "<td>$num_emps</td>"; } echo "</tr>"; } echo "</table>"; echo "</body></html>"; oci_free_statement($stmt); oci_close($conn); ?> ]]> </programlisting> </example> </para> <para> <function>oci_new_cursor</function> Èç¹û³ö´í·µ»Ø &false;¡£ </para> <note> <para> ÔÚ PHP 5.0.0 ֮ǰµÄ°æ±¾±ØÐëʹÓà <function>ocinewcursor</function> Ìæ´ú±¾º¯Êý¡£¸Ãº¯ÊýÃûÈÔÈ»¿ÉÓã¬ÎªÏòϼæÈÝ×÷Ϊ <function>oci_new_cursor</function> µÄ±ðÃû¡£²»¹ýÆäÒѱ»·ÏÆú£¬²»ÍƼöʹÓᣠ</para> </note> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-zh/reference/oci8/functions/oci-new-descriptor.xml?r=1.1&p=1 Index: phpdoc-zh/reference/oci8/functions/oci-new-descriptor.xml +++ phpdoc-zh/reference/oci8/functions/oci-new-descriptor.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.7 Maintainer: yincheng Status: ready --> <!-- CREDITS: dallas --> <refentry id="function.oci-new-descriptor"> <refnamediv> <refname>oci_new_descriptor</refname> <refpurpose>³õʼ»¯Ò»¸öÐÂµÄ¿Õ LOB »ò FILE ÃèÊö·û</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>OCI-Lob</type><methodname>oci_new_descriptor</methodname> <methodparam><type>resource</type><parameter>connection</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>type</parameter></methodparam> </methodsynopsis> <para> <function>oci_new_descriptor</function> ·ÖÅä×ÊÔ´ÒÔ±£´æÃèÊö·û»ò LOB ¶¨Î»Æ÷¡£ÓÐЧµÄ <parameter>type</parameter> ÖµÊÇ£º<constant>OCI_D_FILE</constant>£¬<constant>OCI_D_LOB</constant> ÒÔ¼° <constant>OCI_D_ROWID</constant>¡£ </para> <para> <example> <title><function>oci_new_descriptor</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php /* This script is designed to be called from a HTML form. * It expects $user, $password, $table, $where, and $commitsize * to be passed in from the form. The script then deletes * the selected rows using the ROWID and commits after each * set of $commitsize rows. (Use with care, there is no rollback) */ $conn = oci_connect($user, $password); $stmt = oci_parse($conn, "select rowid from $table $where"); $rowid = oci_new_descriptor($conn, OCI_D_ROWID); oci_define_by_name($stmt, "ROWID", $rowid); oci_execute($stmt); while (oci_fetch($stmt)) { $nrows = oci_num_rows($stmt); $delete = oci_parse($conn, "delete from $table where ROWID = :rid"); oci_bind_by_name($delete, ":rid", $rowid, -1, OCI_B_ROWID); oci_execute($delete); echo "$nrows\n"; if (($nrows % $commitsize) == 0) { oci_commit($conn); } } $nrows = oci_num_rows($stmt); echo "$nrows deleted...\n"; oci_free_statement($stmt); oci_close($conn); ?> ]]> </programlisting> <programlisting role="php"> <![CDATA[ <?php /* This script demonstrates file upload to LOB columns * The formfield used for this example looks like this * <form action="upload.php" method="post" enctype="multipart/form-data"> * <input type="file" name="lob_upload" /> * ... */ if (!isset($lob_upload) || $lob_upload == 'none'){ ?> <form action="upload.php" method="post" enctype="multipart/form-data"> Upload file: <input type="file" name="lob_upload" /><br /> <input type="submit" value="Upload" /> - <input type="reset" value="Reset" /> </form> <?php } else { // $lob_upload contains the temporary filename of the uploaded file // see also the features section on file upload, // if you would like to use secure uploads $conn = oci_connect($user, $password); $lob = oci_new_descriptor($conn, OCI_D_LOB); $stmt = oci_parse($conn, "insert into $table (id, the_blob) values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob"); oci_bind_by_name($stmt, ':the_blob', $lob, -1, OCI_B_BLOB); oci_execute($stmt, OCI_DEFAULT); if ($lob->savefile($lob_upload)){ oci_commit($conn); echo "Blob successfully uploaded\n"; }else{ echo "Couldn't upload Blob\n"; } oci_free_descriptor($lob); oci_free_statement($stmt); oci_close($conn); } ?> ]]> </programlisting> </example> <example> <title><function>oci_new_descriptor</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ <?php /* Calling PL/SQL stored procedures which contain clobs as input * parameters (PHP 4 >= 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 = oci_connect($user, $password); $stmt = oci_parse($conn, "begin save_data(:key, :data); end;"); $clob = oci_new_descriptor($conn, OCI_D_LOB); oci_bind_by_name($stmt, ':key', $key); oci_bind_by_name($stmt, ':data', $clob, -1, OCI_B_CLOB); $clob->write($data); oci_execute($stmt, OCI_DEFAULT); oci_commit($conn); $clob->free(); oci_free_statement($stmt); ?> ]]> </programlisting> </example> </para> <para> <function>oci_new_descriptor</function> Èç¹û³ö´í·µ»Ø &false;¡£ </para> <note> <para> ÔÚ PHP 5.0.0 ֮ǰµÄ°æ±¾±ØÐëʹÓà <function>ocinewdescriptor</function> Ìæ´ú±¾º¯Êý¡£¸Ãº¯ÊýÃûÈÔÈ»¿ÉÓã¬ÎªÏòϼæÈÝ×÷Ϊ <function>oci_new_descriptor</function> µÄ±ðÃû¡£²»¹ýÆäÒѱ»·ÏÆú£¬²»ÍƼöʹÓᣠ</para> </note> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.doc.zh (#2618) next »