cvs: phpdoc-zh /reference/oci8/functions ocibindbyname.xml

From: Date: Thu, 17 Oct 2002 09:44:01 +0000
Subject: cvs: phpdoc-zh /reference/oci8/functions ocibindbyname.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-735@lists.php.net to get a copy of this message
yincheng Thu Oct 17 05:44:01 2002 EDT Added files: /phpdoc-zh/reference/oci8/functions ocibindbyname.xml Log: ·­ÒëÍê³É Index: phpdoc-zh/reference/oci8/functions/ocibindbyname.xml +++ phpdoc-zh/reference/oci8/functions/ocibindbyname.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- $Author: yincheng $ --> <!-- EN-Revision: 1.2 Maintainer: yincheng Status: ready --> <!-- CREDITS: xuke --> <!-- splitted from ./en/functions/oci8.xml, last change in rev 1.2 --> <refentry id="function.ocibindbyname"> <refnamediv> <refname>OCIBindByName</refname> <refpurpose> °ó¶¨Ò»¸ö PHP ±äÁ¿µ½Ò»¸ö Oracle λÖñêÖ¾·û </refpurpose> </refnamediv> <refsect1> <title>ÃèÊö</title> <methodsynopsis> <type>int</type><methodname>OCIBindByName</methodname> <methodparam><type>int</type><parameter>stmt</parameter></methodparam> <methodparam><type>string</type><parameter>ph_name</parameter></methodparam> <methodparam><type>mixed &amp;</type><parameter>variable</parameter></methodparam> <methodparam><type>int</type><parameter>length</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter> type</parameter></methodparam> </methodsynopsis> <para> <function>OCIBindByName</function> ²ÎÊý <parameter>variable</parameter> °ÑÒ»¸ö PHP±ä Á¿°ó¶¨µ½ Oracle µÄλÖñêÖ¾·û <parameter>ph_name</parameter>¡£¸Ã±äÁ¿ÊÇ·ñ»á±»ÓÃ×÷ÊäÈëÊä³öÊÇÔÚÔËÐÐʱ¾ö¶¨µÄ£¬²¢ÇÒº¯Êý¸ø¸Ã±äÁ¿·ÖÅä±ØÒªµÄ´æ´¢¿Õ¼ä¡£ ²ÎÊý length È·¶¨¸Ã°ó¶¨µÄ×î´ó³¤¶È£¬Èç¹û½« length ÉèΪ £­1£¬º¯Êý OCIBindByName() »áÓøñäÁ¿µÄµ±Ç°³¤¶ÈÈ·¶¨°ó¶¨µÄ×î´ó³¤¶È¡£ </para> <para> Èç¹ûÄãÒª°ó¶¨Ò»¸ö³éÏóÊý¾ÝÀàÐÍ£¨LOB/ROWID/BFILE£©£¬ÄãÐèÒªÏÈÓà OCINewDescriptor() º¯Êý½øÐж¨Î»¡£²ÎÊý length ÔÚÕâÖÖÇé¿öϲ»¿ÉÓã¬Ó¦¸Ã±»ÉèΪ£­1¡£ ²ÎÊý type ¸æËß Oracle ÎÒÃÇÏ£ÍûʹÓÃʲôÑùµÄÃèÊö·û£» ¿ÉÄܵÄֵΪ£º 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)¡£ </para> <example> <title>OCIDefineByName</title> <programlisting> <![CDATA[ <?php /* OCIBindByPos example thies@thieso.net (980221) inserts 3 records into emp, and uses the ROWID for updating the records just after the insert. */ $conn = OCILogon("scott","tiger"); $stmt = OCIParse($conn,"insert into emp (empno, ename) ". "values (:empno,:ename) ". "returning ROWID into :rid"); $data = array(1111 => "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; while (list($empno,$ename) = each($data)) { 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); ?> ]]> </programlisting> </example> <warning> <para> ͬʱʹÓÃħÊõÒýÓÃºÍ OCIBindByName£¨£©º¯ÊýÊÇÒ»¸ö»µÖ÷Ò⣻ÕâÊÇÒòΪ£º1¡¢±»ÒýÓõıäÁ¿²»ÐèÒªÈκÎÒýÓã»2¡¢ÓÉ OCIBindByName£¨£©º¯Êý²»ÄÜ·Ö±æ×Ô¶¯Ìí¼ÓµÄÒýÓúÍרÃżÓÉϵÄÒýÓã¬ÕâÑùËùÓÐħÊõÓ¦Óö¼»á±»Ð´µ½Êý¾Ý¿âÖС£ </para> </warning> </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 (#735) next »