<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Funções do Oracle 8</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="Referência das Funções" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="overload" HREF="function.overload.html"><LINK REL="NEXT" TITLE="oci_bind_array_by_name" HREF="function.oci-bind-array-by-name.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.overload.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.oci-bind-array-by-name.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.oci8" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >CVII. Funções do Oracle 8</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN150660" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="oci8.intro" >Introdução</A ></H1 ><P > Essas funções permitem que você acesse Banco de Dados Oracle8 and Oracle7. Elas usam uma interface de comunicação para Oracle8 chamada (OCI8) </P ><P > Essa extensão é mais flexível do que a extensão <A HREF="ref.oracle.html" >standard Oracle</A >. Ela tem suporte para passar variáveis PHP locais e globais para o "Oracle placeholders", tem suporte completo à LOB, FILE e ROWID e permite que você use variáveis definidas pelo usuário. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="oci8.requirements" >Dependências</A ></H1 ><P > Você irá precisar de bibliotecas do cliente Oracle8 para usar esta extensão. Usuários Windows irão precisar das últimas versões do Oracle 8.1 para usar a <TT CLASS="filename" >php_oci8.dll</TT > dll. </P ><P > Antes de usar esta extensão, tenha certeza de que você tem setado sua variável de ambiente Oracle corretamente para seu usuário Oracle, bem como para seu usuário do seu web daemon. As variáveis que você pode precisar setar são as seguintes: <P ></P ><UL ><LI ><P > ORACLE_HOME </P ></LI ><LI ><P > ORACLE_SID </P ></LI ><LI ><P > LD_PRELOAD </P ></LI ><LI ><P > LD_LIBRARY_PATH </P ></LI ><LI ><P > NLS_LANG </P ></LI ><LI ><P > ORA_NLS33 </P ></LI ></UL > </P ><P > Após setá-las para seu usuário de webserver, tenha certeza também de adicionar seu usuário do webserver (nobody, www) para o grupo oracle. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Se seu servidor web não iniciar ou colidir ao iniciar: </B > Verifique que o Apache está "linkado" com a biblioteca pthread: </P ><P > <DIV CLASS="informalexample" ><P ></P ><A NAME="AEN150689" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="screen" ># ldd /www/apache/bin/httpd libpthread.so.0 => /lib/libpthread.so.0 (0x4001c000) libm.so.6 => /lib/libm.so.6 (0x4002f000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x4004c000) libdl.so.2 => /lib/libdl.so.2 (0x4007a000) libc.so.6 => /lib/libc.so.6 (0x4007e000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)</PRE ></TD ></TR ></TABLE ><P ></P ></DIV > </P ><P > Se a libpthread não estiver listada você terá de recompilar o Apache: </P ><P > <DIV CLASS="informalexample" ><P ></P ><A NAME="AEN150693" ></A ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="screen" ># cd /usr/src/apache_1.3.xx # make clean # LIBS=-lpthread ./config.status # make # make install</PRE ></TD ></TR ></TABLE ><P ></P ></DIV > </P ><P > Por favor note que em alguns sistemas como UnixWare isto é libthread ao invés de libpthread. PHP e Apache estão configurados com EXTRA_LIBS=-lthread. </P ></BLOCKQUOTE ></DIV ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="oci8.installation" >Instalação</A ></H1 ><P > Você tem que compilar o PHP com a opção <CODE CLASS="option" >--with-oci8[=DIR]</CODE >, onde DIR é a variável de ambiente ORACLE_HOME. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="oci8.configuration" >Configurações em execução</A ></H1 ><P >Esta extensão não define nenhum parâmetro de configuração no <TT CLASS="filename" >php.ini</TT >.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="oci8.resources" >Tipos Resource</A ></H1 ><P > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="oci8.constants" >Constantes pré-definidas</A ></H1 ><P > As contantes abaixo são definidas por esta extensão e somente estarão disponíveis quando a extensão foi compilada com o PHP ou carregada dinamicamente durante a execução. </P ><P ></P ><DIV CLASS="variablelist" ><DL ><DT ><TT CLASS="constant" ><B >OCI_DEFAULT</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Statement execution mode. Statement is not committed automatically when using this mode. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_DESCRIBE_ONLY</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Statement execution mode. Use this mode if you don't want to execute the query, but get the select-list's description. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_COMMIT_ON_SUCCESS</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Statement execution mode. Statement is automatically committed after <A HREF="function.oci-execute.html" ><B CLASS="function" >oci_execute()</B ></A > call. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_EXACT_FETCH</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Statement fetch mode. Used when the application knows in advance exactly how many rows it will be fetching. This mode turns prefetching off for Oracle release 8 or later mode. Cursor is cancelled after the desired rows are fetched and may result in reduced server-side resource usage. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_SYSDATE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_B_BFILE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > when binding BFILEs. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_B_CFILEE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > when binding CFILEs. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_B_CLOB</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > when binding CLOBs. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_B_BLOB</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > when binding BLOBs. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_B_ROWID</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > when binding ROWIDs. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_B_CURSOR</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > when binding cursors, previously allocated with <A HREF="function.oci-new-descriptor.html" ><B CLASS="function" >oci_new_descriptor()</B ></A >. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_B_NTY</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > when binding named data types. Note: in PHP < 5.0 it was called <TT CLASS="constant" ><B >OCI_B_SQLT_NTY</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_B_BIN</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_BFILEE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_B_BFILE</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_CFILEE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_B_CFILEE</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_CLOB</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_B_CLOB</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_BLOB</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_B_BLOB</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_RDD</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_B_ROWID</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_NTY</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_B_NTY</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_LNG</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > to bind LONG values. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_LBI</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > to bind LONG RAW values. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_BIN</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A > to bind RAW values. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_NUM</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of NUMBER. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_INT</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of INTEGER. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_AFC</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of CHAR. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_CHR</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of VARCHAR2. Also used with <A HREF="function.oci-bind-by-name.html" ><B CLASS="function" >oci_bind_by_name()</B ></A >. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_VCS</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of VARCHAR. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_AVC</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of CHARZ. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_STR</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of STRING. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_LVC</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of LONG VARCHAR. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_FLT</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of FLOAT. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_ODT</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-bind-array-by-name.html" ><B CLASS="function" >oci_bind_array_by_name()</B ></A > to bind arrays of LONG. </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_BDOUBLE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >SQLT_BFLOAT</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_FETCHSTATEMENT_BY_COLUMN</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Default mode of <A HREF="function.oci-fetch-all.html" ><B CLASS="function" >oci_fetch_all()</B ></A >. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_FETCHSTATEMENT_BY_ROW</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Alternative mode of <A HREF="function.oci-fetch-all.html" ><B CLASS="function" >oci_fetch_all()</B ></A >. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_ASSOC</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-fetch-all.html" ><B CLASS="function" >oci_fetch_all()</B ></A > and <A HREF="function.oci-fetch-array.html" ><B CLASS="function" >oci_fetch_array()</B ></A > to get an associative array as a result. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_NUM</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-fetch-all.html" ><B CLASS="function" >oci_fetch_all()</B ></A > and <A HREF="function.oci-fetch-array.html" ><B CLASS="function" >oci_fetch_array()</B ></A > to get an enumerated array as a result. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_BOTH</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-fetch-all.html" ><B CLASS="function" >oci_fetch_all()</B ></A > and <A HREF="function.oci-fetch-array.html" ><B CLASS="function" >oci_fetch_array()</B ></A > to get an array with both associative and number indices. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_RETURN_NULLS</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-fetch-array.html" ><B CLASS="function" >oci_fetch_array()</B ></A > to get empty array elements if field's value is <TT CLASS="constant" ><B >NULL</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_RETURN_LOBS</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-fetch-array.html" ><B CLASS="function" >oci_fetch_array()</B ></A > to get value of LOB instead of the descriptor. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_DTYPE_FILE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > This flag tells <A HREF="function.oci-new-descriptor.html" ><B CLASS="function" >oci_new_descriptor()</B ></A > to initialize new FILE descriptor. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_DTYPE_LOB</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > This flag tells <A HREF="function.oci-new-descriptor.html" ><B CLASS="function" >oci_new_descriptor()</B ></A > to initialize new LOB descriptor. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_DTYPE_ROWID</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > This flag tells <A HREF="function.oci-new-descriptor.html" ><B CLASS="function" >oci_new_descriptor()</B ></A > to initialize new ROWID descriptor. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_D_FILE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_DTYPE_FILE</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_D_LOB</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_DTYPE_LOB</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_D_ROWID</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > The same as <TT CLASS="constant" ><B >OCI_DTYPE_ROWID</B ></TT >. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_SYSOPER</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-connect.html" ><B CLASS="function" >oci_connect()</B ></A > to connect as SYSOPER using external credentials (<A HREF="missing-stuff.html#ini.oci8.privileged_connect" >oci8.privileged_connect</A > should be enabled for this). </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_SYSDBA</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-connect.html" ><B CLASS="function" >oci_connect()</B ></A > to connect as SYSDBA using external credentials (<A HREF="missing-stuff.html#ini.oci8.privileged_connect" >oci8.privileged_connect</A > should be enabled for this). </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_LOB_BUFFER_FREE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-lob-flush.html" >OCI-Lob->flush</A > to free buffers used. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_TEMP_CLOB</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-lob-writetemporary.html" >OCI-Lob->writeTemporary</A > to indicate explicilty that temporary CLOB should be created. </P ></DD ><DT ><TT CLASS="constant" ><B >OCI_TEMP_BLOB</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > Used with <A HREF="function.oci-lob-writetemporary.html" >OCI-Lob->writeTemporary</A > to indicate explicilty that temporary BLOB should be created. </P ></DD ></DL ></DIV ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="oci8.examples" >Exemplos</A ></H1 ><P > <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN151080" ></A ><P ><B >Exemplo 1. OCI Hints</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#FF8000">// by sergo@bacup.ru<br /><br />// Use a opção: OCI_DEFAULT para executar comandos para atrasar a execução<br /></font><font color="#0000BB">OCIExecute</font><font color="#007700">(</font><font color="#0000BB">$stmt</font><font color="#007700">, </font><font color="#0000BB">OCI_DEFAULT</font><font color="#007700">);<br /><br /></font><font color="#FF8000">// use isto para retornar dados (após o fetch):<br /><br /></font><font color="#0000BB">$result </font><font color="#007700">= </font><font color="#0000BB">OCIResult</font><font color="#007700">(</font><font color="#0000BB">$stmt</font><font color="#007700">, </font><font color="#0000BB">$n</font><font color="#007700">);<br />if (</font><font color="#0000BB">is_object </font><font color="#007700">(</font><font color="#0000BB">$result</font><font color="#007700">)) </font><font color="#0000BB">$result </font><font color="#007700">= </font><font color="#0000BB">$result</font><font color="#007700">-></font><font color="#0000BB">load</font><font color="#007700">();<br /><br /></font><font color="#FF8000">// Para comandos INSERT ou UPDATE use:<br /><br /></font><font color="#0000BB">$sql </font><font color="#007700">= </font><font color="#DD0000">"insert into table (field1, field2) values (field1 = 'value',<br /> field2 = empty_clob()) returning field2 into :field2"</font><font color="#007700">;<br /></font><font color="#0000BB">OCIParse</font><font color="#007700">(</font><font color="#0000BB">$conn</font><font color="#007700">, </font><font color="#0000BB">$sql</font><font color="#007700">);<br /></font><font color="#0000BB">$clob </font><font color="#007700">= </font><font color="#0000BB">OCINewDescriptor</font><font color="#007700">(</font><font color="#0000BB">$conn</font><font color="#007700">, </font><font color="#0000BB">OCI_D_LOB</font><font color="#007700">);<br /></font><font color="#0000BB">OCIBindByName </font><font color="#007700">(</font><font color="#0000BB">$stmt</font><font color="#007700">, </font><font color="#DD0000">":field2"</font><font color="#007700">, &</font><font color="#0000BB">$clob</font><font color="#007700">, -</font><font color="#0000BB">1</font><font color="#007700">, </font><font color="#0000BB">OCI_B_CLOB</font><font color="#007700">);<br /></font><font color="#0000BB">OCIExecute</font><font color="#007700">(</font><font color="#0000BB">$stmt</font><font color="#007700">, </font><font color="#0000BB">OCI_DEFAULT</font><font color="#007700">);<br /></font><font color="#0000BB">$clob</font><font color="#007700">-></font><font color="#0000BB">save </font><font color="#007700">(</font><font color="#DD0000">"some text"</font><font color="#007700">);<br /></font><font color="#0000BB">OCICommit</font><font color="#007700">(</font><font color="#0000BB">$conn</font><font color="#007700">);<br /><br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > Você pode facilmente acessar stored procedures da mesma forma como você faz em linha de comando. <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN151084" ></A ><P ><B >Exemplo 2. Usando Stored Procedures</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#FF8000">// by webmaster@remoterealty.com<br /></font><font color="#0000BB">$sth </font><font color="#007700">= </font><font color="#0000BB">OCIParse </font><font color="#007700">( </font><font color="#0000BB">$dbh</font><font color="#007700">, </font><font color="#DD0000">"begin sp_newaddress( :address_id, '$firstname',<br /> '$lastname', '$company', '$address1', '$address2', '$city', '$state',<br /> '$postalcode', '$country', :error_code );end;" </font><font color="#007700">);<br /><br /></font><font color="#FF8000">// Essa chamada stored procedure sp_newaddress, com :address_id being uma<br />// variável in/out e :error_code sendo uma variável de saída. <br />// Então você faz a passagem<br /><br /><br /> </font><font color="#0000BB">OCIBindByName </font><font color="#007700">( </font><font color="#0000BB">$sth</font><font color="#007700">, </font><font color="#DD0000">":address_id"</font><font color="#007700">, </font><font color="#0000BB">$addr_id</font><font color="#007700">, </font><font color="#0000BB">10 </font><font color="#007700">);<br /> </font><font color="#0000BB">OCIBindByName </font><font color="#007700">( </font><font color="#0000BB">$sth</font><font color="#007700">, </font><font color="#DD0000">":error_code"</font><font color="#007700">, </font><font color="#0000BB">$errorcode</font><font color="#007700">, </font><font color="#0000BB">10 </font><font color="#007700">);<br /> </font><font color="#0000BB">OCIExecute </font><font color="#007700">( </font><font color="#0000BB">$sth </font><font color="#007700">);<br /><br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Índice</B ></DT ><DT ><A HREF="function.oci-bind-array-by-name.html" >oci_bind_array_by_name</A > -- Binds PHP array to Oracle PL/SQL array by name</DT ><DT ><A HREF="function.oci-bind-by-name.html" >oci_bind_by_name</A > -- Binds the PHP variable to the Oracle placeholder</DT ><DT ><A HREF="function.oci-cancel.html" >oci_cancel</A > -- Cancels reading from cursor</DT ><DT ><A HREF="function.oci-close.html" >oci_close</A > -- Closes Oracle connection</DT ><DT ><A HREF="function.oci-collection-append.html" >OCI-Collection->append</A > -- Appends element to the collection</DT ><DT ><A HREF="function.oci-collection-assign.html" >OCI-Collection->assign</A > -- Assigns a value to the collection from another existing collection</DT ><DT ><A HREF="function.oci-collection-element-assign.html" >OCI-Collection->assignElem</A > -- Assigns a value to the element of the collection</DT ><DT ><A HREF="function.oci-collection-free.html" >OCI-Collection->free</A > -- Frees the resources associated with the collection object</DT ><DT ><A HREF="function.oci-collection-element-get.html" >OCI-Collection->getElem</A > -- Returns value of the element</DT ><DT ><A HREF="function.oci-collection-max.html" >OCI-Collection->max</A > -- Returns the maximum number of elements in the collection</DT ><DT ><A HREF="function.oci-collection-size.html" >OCI-Collection->size</A > -- Returns size of the collection</DT ><DT ><A HREF="function.oci-collection-trim.html" >OCI-Collection->trim</A > -- Trims elements from the end of the collection</DT ><DT ><A HREF="function.oci-commit.html" >oci_commit</A > -- Commits outstanding statements</DT ><DT ><A HREF="function.oci-connect.html" >oci_connect</A > -- Establishes a connection to the Oracle server</DT ><DT ><A HREF="function.oci-define-by-name.html" >oci_define_by_name</A > -- Uses a PHP variable for the define-step during a SELECT</DT ><DT ><A HREF="function.oci-error.html" >oci_error</A > -- Returns the last error found</DT ><DT ><A HREF="function.oci-execute.html" >oci_execute</A > -- Executes a statement</DT ><DT ><A HREF="function.oci-fetch-all.html" >oci_fetch_all</A > -- Fetches all rows of result data into an array</DT ><DT ><A HREF="function.oci-fetch-array.html" >oci_fetch_array</A > -- Returns the next row from the result data as an associative or numeric array, or both </DT ><DT ><A HREF="function.oci-fetch-assoc.html" >oci_fetch_assoc</A > -- Returns the next row from the result data as an associative array</DT ><DT ><A HREF="function.oci-fetch-object.html" >oci_fetch_object</A > -- Returns the next row from the result data as an object</DT ><DT ><A HREF="function.oci-fetch-row.html" >oci_fetch_row</A > -- Returns the next row from the result data as a numeric array</DT ><DT ><A HREF="function.oci-fetch.html" >oci_fetch</A > -- Fetches the next row into result-buffer</DT ><DT ><A HREF="function.oci-field-is-null.html" >oci_field_is_null</A > -- Checks if the field is <TT CLASS="constant" ><B >NULL</B ></TT ></DT ><DT ><A HREF="function.oci-field-name.html" >oci_field_name</A > -- Returns the name of a field from the statement</DT ><DT ><A HREF="function.oci-field-precision.html" >oci_field_precision</A > -- Tell the precision of a field</DT ><DT ><A HREF="function.oci-field-scale.html" >oci_field_scale</A > -- Tell the scale of the field</DT ><DT ><A HREF="function.oci-field-size.html" >oci_field_size</A > -- Returns field's size</DT ><DT ><A HREF="function.oci-field-type-raw.html" >oci_field_type_raw</A > -- Tell the raw Oracle data type of the field</DT ><DT ><A HREF="function.oci-field-type.html" >oci_field_type</A > -- Returns field's data type</DT ><DT ><A HREF="function.oci-free-statement.html" >oci_free_statement</A > -- Frees all resources associated with statement or cursor</DT ><DT ><A HREF="function.oci-internal-debug.html" >oci_internal_debug</A > -- Enables or disables internal debug output</DT ><DT ><A HREF="function.oci-lob-append.html" >OCI-Lob->append</A > -- Appends data from the large object to another large object</DT ><DT ><A HREF="function.oci-lob-close.html" >OCI-Lob->close</A > -- Closes LOB descriptor</DT ><DT ><A HREF="function.oci-lob-copy.html" >oci_lob_copy</A > -- Copies large object</DT ><DT ><A HREF="function.oci-lob-eof.html" >OCI-Lob->eof</A > -- Tests for end-of-file on a large object's descriptor</DT ><DT ><A HREF="function.oci-lob-erase.html" >OCI-Lob->erase</A > -- Erases a specified portion of the internal LOB data</DT ><DT ><A HREF="function.oci-lob-export.html" >OCI-Lob->export</A > -- Exports LOB's contents to a file</DT ><DT ><A HREF="function.oci-lob-flush.html" >OCI-Lob->flush</A > -- Flushes/writes buffer of the LOB to the server</DT ><DT ><A HREF="function.oci-lob-free.html" >OCI-Lob->free</A > -- Frees resources associated with the LOB descriptor</DT ><DT ><A HREF="function.oci-lob-getbuffering.html" >OCI-Lob->getBuffering</A > -- Returns current state of buffering for the large object</DT ><DT ><A HREF="function.oci-lob-import.html" >OCI-Lob->import</A > -- Imports file data to the LOB</DT ><DT ><A HREF="function.oci-lob-is-equal.html" >oci_lob_is_equal</A > -- Compares two LOB/FILE locators for equality</DT ><DT ><A HREF="function.oci-lob-load.html" >OCI-Lob->load</A > -- Returns large object's contents</DT ><DT ><A HREF="function.oci-lob-read.html" >OCI-Lob->read</A > -- Reads part of the large object</DT ><DT ><A HREF="function.oci-lob-rewind.html" >OCI-Lob->rewind</A > -- Moves the internal pointer to the beginning of the large object</DT ><DT ><A HREF="function.oci-lob-save.html" >OCI-Lob->save</A > -- Saves data to the large object</DT ><DT ><A HREF="function.oci-lob-savefile.html" >OCI-Lob->saveFile</A > -- Sinônimo de <A HREF="function.oci-lob-import.html" ><B CLASS="function" >oci_lob_import()</B ></A ></DT ><DT ><A HREF="function.oci-lob-seek.html" >OCI-Lob->seek</A > -- Sets the internal pointer of the large object</DT ><DT ><A HREF="function.oci-lob-setbuffering.html" >OCI-Lob->setBuffering</A > -- Changes current state of buffering for the large object</DT ><DT ><A HREF="function.oci-lob-size.html" >OCI-Lob->size</A > -- Returns size of large object</DT ><DT ><A HREF="function.oci-lob-tell.html" >OCI-Lob->tell</A > -- Returns current position of internal pointer of large object</DT ><DT ><A HREF="function.oci-lob-truncate.html" >OCI-Lob->truncate</A > -- Truncates large object</DT ><DT ><A HREF="function.oci-lob-write.html" >OCI-Lob->write</A > -- Writes data to the large object</DT ><DT ><A HREF="function.oci-lob-writetemporary.html" >OCI-Lob->writeTemporary</A > -- Writes temporary large object</DT ><DT ><A HREF="function.oci-lob-writetofile.html" >OCI-Lob->writeToFile</A > -- Sinônimo de <A HREF="function.oci-lob-export.html" ><B CLASS="function" >oci_lob_export()</B ></A ></DT ><DT ><A HREF="function.oci-new-collection.html" >oci_new_collection</A > -- Allocates new collection object</DT ><DT ><A HREF="function.oci-new-connect.html" >oci_new_connect</A > -- Establishes a new connection to the Oracle server</DT ><DT ><A HREF="function.oci-new-cursor.html" >oci_new_cursor</A > -- Allocates and returns a new cursor (statement handle)</DT ><DT ><A HREF="function.oci-new-descriptor.html" >oci_new_descriptor</A > -- Initializes a new empty LOB or FILE descriptor</DT ><DT ><A HREF="function.oci-num-fields.html" >oci_num_fields</A > -- Returns the number of result columns in a statement</DT ><DT ><A HREF="function.oci-num-rows.html" >oci_num_rows</A > -- Returns number of rows affected during statement execution</DT ><DT ><A HREF="function.oci-parse.html" >oci_parse</A > -- Prepares Oracle statement for execution</DT ><DT ><A HREF="function.oci-password-change.html" >oci_password_change</A > -- Changes password of Oracle's user</DT ><DT ><A HREF="function.oci-pconnect.html" >oci_pconnect</A > -- Connect to an Oracle database using a persistent connection</DT ><DT ><A HREF="function.oci-result.html" >oci_result</A > -- Returns field's value from the fetched row</DT ><DT ><A HREF="function.oci-rollback.html" >oci_rollback</A > -- Rolls back outstanding transaction</DT ><DT ><A HREF="function.oci-server-version.html" >oci_server_version</A > -- Returns server version</DT ><DT ><A HREF="function.oci-set-prefetch.html" >oci_set_prefetch</A > -- Sets number of rows to be prefetched</DT ><DT ><A HREF="function.oci-statement-type.html" >oci_statement_type</A > -- Returns the type of an OCI statement</DT ><DT ><A HREF="function.ocibindbyname.html" >ocibindbyname</A > -- Passa variáveis PHP para um ambiente de armazenamento do Oracle </DT ><DT ><A HREF="function.ocicancel.html" >ocicancel</A > -- Cancela leitura de um cursor</DT ><DT ><A HREF="function.ocicloselob.html" >ocicloselob</A > -- Fecha um lob</DT ><DT ><A HREF="function.ocicollappend.html" >ocicollappend</A > -- Insere um objeto em uma coleção</DT ><DT ><A HREF="function.ocicollassign.html" >ocicollassign</A > -- Fixa uma coleção para outra coleção existente</DT ><DT ><A HREF="function.ocicollassignelem.html" >ocicollassignelem</A > -- Fixa elementos val para coleções em index ndx</DT ><DT ><A HREF="function.ocicollgetelem.html" >ocicollgetelem</A > -- Retorna o valor contido em coleção index ndx</DT ><DT ><A HREF="function.ocicollmax.html" >ocicollmax</A > -- Retorna o valor máximo de uma coleção. Para um array este é o comprimento máximo de um array </DT ><DT ><A HREF="function.ocicollsize.html" >ocicollsize</A > -- Retorna o tamanho de uma coleção</DT ><DT ><A HREF="function.ocicolltrim.html" >ocicolltrim</A > -- Corta um número de elementos do final de uma coleção</DT ><DT ><A HREF="function.ocicolumnisnull.html" >ocicolumnisnull</A > -- Testa se o resultado de uma coluna é <TT CLASS="constant" ><B >NULL</B ></TT ></DT ><DT ><A HREF="function.ocicolumnname.html" >ocicolumnname</A > -- Retorna o nome de uma coluna</DT ><DT ><A HREF="function.ocicolumnprecision.html" >ocicolumnprecision</A > -- Diz a precisão de uma coluna</DT ><DT ><A HREF="function.ocicolumnscale.html" >ocicolumnscale</A > -- Diz a escala de uma coluna</DT ><DT ><A HREF="function.ocicolumnsize.html" >ocicolumnsize</A > -- Retorna o tamanho de uma coluna</DT ><DT ><A HREF="function.ocicolumntype.html" >ocicolumntype</A > -- Retorna o tipo de dados de uma coluna</DT ><DT ><A HREF="function.ocicolumntyperaw.html" >ocicolumntyperaw</A > -- Diz um tipo de dados indefinido de uma coluna Oracle</DT ><DT ><A HREF="function.ocicommit.html" >ocicommit</A > -- Valida uma transação pendente</DT ><DT ><A HREF="function.ocidefinebyname.html" >ocidefinebyname</A > -- Usa uma variável PHP para a definição de passos durante um SELECT </DT ><DT ><A HREF="function.ocierror.html" >ocierror</A > -- Retorna o último erro de stmt|conn|global</DT ><DT ><A HREF="function.ociexecute.html" >ociexecute</A > -- Executa um bloco de comando</DT ><DT ><A HREF="function.ocifetch.html" >ocifetch</A > -- Traz a próximo linha em um result-buffer</DT ><DT ><A HREF="function.ocifetchinto.html" >ocifetchinto</A > -- Traz a poxima linha em um array</DT ><DT ><A HREF="function.ocifetchstatement.html" >ocifetchstatement</A > -- Traz todas as linhas de um tipo de dados em um array</DT ><DT ><A HREF="function.ocifreecollection.html" >ocifreecollection</A > -- Deleta uma coleção de objeto</DT ><DT ><A HREF="function.ocifreecursor.html" >ocifreecursor</A > -- Libera todos os recursos associados à um cursor </DT ><DT ><A HREF="function.ocifreedesc.html" >ocifreedesc</A > -- Deleta um grande objeto de descrição</DT ><DT ><A HREF="function.ocifreestatement.html" >ocifreestatement</A > -- Libera todos os recursos associados à uma declaração </DT ><DT ><A HREF="function.ociinternaldebug.html" >ociinternaldebug</A > -- Habilita ou desabilita o sistema interno de debug </DT ><DT ><A HREF="function.ociloadlob.html" >ociloadlob</A > -- Carrega um objeto grande</DT ><DT ><A HREF="function.ocilogoff.html" >ocilogoff</A > -- Disconecta de um servidor Oracle</DT ><DT ><A HREF="function.ocilogon.html" >ocilogon</A > -- Estabiliza uma conexão com o Oracle</DT ><DT ><A HREF="function.ocinewcollection.html" >ocinewcollection</A > -- Inicializa uma nova coleção</DT ><DT ><A HREF="function.ocinewcursor.html" >ocinewcursor</A > -- Retorna um novo cursor (Statement-Handle) </DT ><DT ><A HREF="function.ocinewdescriptor.html" >ocinewdescriptor</A > -- Inicializa um novo descritor LOB ou FILE vazios </DT ><DT ><A HREF="function.ocinlogon.html" >ocinlogon</A > -- Estabiliza uma nova conexão com o Oracle</DT ><DT ><A HREF="function.ocinumcols.html" >ocinumcols</A > -- Retorna o número de colunas encontradas em uma instrução </DT ><DT ><A HREF="function.ociparse.html" >ociparse</A > -- Interpreta uma query e retorna uma declaração Oracle</DT ><DT ><A HREF="function.ociplogon.html" >ociplogon</A > -- Conecta no Oracle usando uma conexão persistente </DT ><DT ><A HREF="function.ociresult.html" >ociresult</A > -- Retorna valores de colunas trazidas por uma linha</DT ><DT ><A HREF="function.ocirollback.html" >ocirollback</A > -- Volta uma transação</DT ><DT ><A HREF="function.ocirowcount.html" >ocirowcount</A > -- Retorna o número de linhas afetadas</DT ><DT ><A HREF="function.ocisavelob.html" >ocisavelob</A > -- Salva o alargamento do objeto</DT ><DT ><A HREF="function.ocisavelobfile.html" >ocisavelobfile</A > -- Salva o alargamento de objeto para um arquivo</DT ><DT ><A HREF="function.ociserverversion.html" >ociserverversion</A > -- Retorna uma string contendo informações da versão do servidor</DT ><DT ><A HREF="function.ocisetprefetch.html" >ocisetprefetch</A > -- Seta o número de linhas a serem trazidas</DT ><DT ><A HREF="function.ocistatementtype.html" >ocistatementtype</A > -- Retorna o tipo de uma declaração OCI</DT ><DT ><A HREF="function.ociwritelobtofile.html" >ociwritelobtofile</A > -- Salva um grande objeto para arquivo</DT ><DT ><A HREF="function.ociwritetemporarylob.html" >ociwritetemporarylob</A > -- Escreve um blob temporário</DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.overload.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.oci-bind-array-by-name.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >overload</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >oci_bind_array_by_name</TD ></TR ></TABLE ></DIV ></BODY ></HTML >