goba Fri Mar 29 09:48:24 2002 EDT
Modified files:
/phpdoc/hu/functions oci8.xml
Log:
Adding 50% translated file
Index: phpdoc/hu/functions/oci8.xml
diff -u /dev/null phpdoc/hu/functions/oci8.xml:1.5
--- /dev/null Fri Mar 29 09:48:24 2002
+++ phpdoc/hu/functions/oci8.xml Fri Mar 29 09:48:23 2002
@@ -0,0 +1,1926 @@
+<?xml version="1.0" encoding="iso-8859-2"?>
+<!-- EN-Revision: 1.44 Maintainer: goba Status: half translated -->
+ <reference id="ref.oci8">
+ <title>Oracle 8 f�ggv�nyek</title>
+ <titleabbrev>OCI8</titleabbrev>
+ <partintro>
+ <para>
+ Ezekkel a f�ggv�nyekkel az Oracle8 �s Oracle7 adatb�zisokat
+ �rheted el, az Oracle8 Call-Interface (OCI8) haszn�lat�val.
+ Az Oracle8 kliens k�nyvt�rakra sz�ks�ged lesz, ha szeretn�d
+ ezt a kiterjeszt�st haszn�lni.
+ </para>
+ <para>
+ Ez a kiterjeszt�s rugalmasabb, mint a hagyom�nyos Oracle
+ kiterjeszt�s. Lehet�v� teszi glob�lis �s lok�lis PHP v�ltoz�k
+ k�t�s�t Oracle �rt�kekhez, teljes LOB, FILE �s ROWID
+ t�mogat�ssal rendelkezik, �s lehet�v� teszi a felhaszn�l�
+ �ltal megadott v�ltoz�k haszn�lat�t.
+ </para>
+ <para>
+ Miel�tt elkezden�d haszn�lni ezt a kiterjeszt�st, gy�z�dj meg
+ r�la, hogy az Oracle k�rnyezeti v�ltoz�k helyesen be vannak
+ �ll�tva az Oracle �s a webszerver felhaszn�l� sz�m�ra. Az
+ �rt�kek, amiket esetleg be kell �ll�tanod a k�vezkez�k:
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ ORACLE_HOME
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ ORACLE_SID
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ LD_PRELOAD
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ LD_LIBRARY_PATH
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ NLS_LANG
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ ORA_NLS33
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Miut�n be�ll�tottad a k�nyezeti v�ltoz�kat a webszerver
+ felhaszn�l� sz�m�ra, add hozz� a webszerver felhaszn�l�t (nobody,
+ www) az oracle csoporthoz.
+ </para>
+ <note>
+ <title>Ha a webszerver nem indul el, vagy lefagy indul�skor</title>
+ <para>
+ Ellen�rizd, hogy az Apache szervert a pthread
+ k�nyvt�rral ford�tottad-e:
+ </para>
+ <para>
+ <informalexample>
+ <screen>
+<![CDATA[
+# 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)
+]]>
+ </screen>
+ </informalexample>
+ </para>
+ <para>
+ Ha a libpthread nincs bent a list�ban, �jra kell
+ telep�tened az Apache szervert:
+ </para>
+ <para>
+ <informalexample>
+ <screen>
+<![CDATA[
+# cd /usr/src/apache_1.3.xx
+# make clean
+# LIBS=-lpthread ./config.status
+# make
+# make install
+]]>
+ </screen>
+ </informalexample>
+ </para>
+ </note>
+ <para>
+ <example>
+ <title>OCI tippek</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+// A tippeket [EMAIL PROTECTED] k�ldte be
+
+// Haszn�ld az OCI_DEFAULT opci�t a v�grehajt�sn�l,
+// ha k�sleltetni szetern�d a v�grehjt�st
+OCIExecute($stmt, OCI_DEFAULT);
+
+// Lek�rdezett adatok haszn�lat�hoz (fetch ut�n):
+
+$result = OCIResult($stmt, $n);
+if (is_object($result)) { $result = $result->load(); }
+
+// INSERT vagy UPDATE parancsokhoz:
+
+$sql = "insert into table (mezo1, mezo2) values (mezo1 = '�rt�k',
+ mezo2 = empty_clob()) returning mezo2 into :mezo2";
+OCIParse($conn, $sql);
+$clob = OCINewDescriptor($conn, OCI_D_LOB);
+OCIBindByName($stmt, ":mezo2", &$clob, -1, OCI_B_CLOB);
+OCIExecute($stmt, OCI_DEFAULT);
+$clob->save("valami sz�veg");
+OCICommit($conn);
+
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ K�nnyen el�rheted a t�rolt elj�r�sokat, �ppen �gy,
+ mint parancssorb�l.
+ <example>
+ <title>T�rolt elj�r�sok haszn�lata</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+// [EMAIL PROTECTED] k�ldte be a k�vetkez� k�dot:
+
+$sth = OCIParse ( $dbh, "begin sp_newaddress( :cimid, '$keresztnev',
+ '$csaladinev', '$ceg', '$cim1', '$cim2', '$varos', '$megye',
+ '$irszam', '$orszag', :hibakod );end;" );
+
+// Ez a parancs megh�vja az sp_newaddress nev� t�rolt elj�r�st,
+// a :cimid ki �s bemeneti v�ltoz�val �s a :hibakod kimeneti
+// v�ltoz�val. Ezut�n a v�ltoz� k�t�seket kell elv�gezni:
+
+ OCIBindByName ( $sth, ":cimid", $cimid, 10 );
+ OCIBindByName ( $sth, ":hibakod", $hibakod, 10 );
+ OCIExecute ( $sth );
+
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </partintro>
+
+ <refentry id="function.ocidefinebyname">
+ <refnamediv>
+ <refname>OCIDefineByName</refname>
+ <refpurpose>
+ PHP v�ltoz� haszn�lata a defini�l�si l�p�sben egy SELECT sz�m�ra
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIDefineByName</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>string</type><parameter>Column-Name</parameter></methodparam>
+ <methodparam><type>mixed</type><parameter>variable</parameter></methodparam>
+ <methodparam
+choice="opt"><type>int</type><parameter>type</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Az <function>OCIDefineByName</function> SQL oszlopok lek�rdez�s�t
+ k�ti felhaszn�l� �ltal defini�lt PHP v�ltoz�khoz. Figyelj arra,
+ hogy az Oracle CSUPA NAGYBET�S neveket haszn�l, de ennek
+ ellen�re �rhatsz a SELECT-ben kisbet�s neveket is. Az
+ <function>OCIDefineByName</function> f�ggv�ny a
+ <parameter>Column-Name</parameter> param�terben a helyes
+ nagybet�s �r�st v�rja. Ha olyan v�ltoz�t defini�lsz, ami nem
+ l�tezik a SELECT eredm�nyt�bl�j�ban, semmilyen hib�t sem kapsz!
+ </para>
+ <para>
+ Ha absztrakt adatt�pust kell defini�lnod (p�ld�ul LOB, ROWID vagy
+ BFILE), el�sz�r az <function>OCINewDescriptor</function>
+ f�ggv�nyt kell haszn�lnod. L�sd m�g az <function>OCIBindByName</function>
+ f�ggv�nyt.
+ </para>
+ <example>
+ <title>OCIDefineByName</title>
+ <programlisting>
+<![CDATA[
+<?php
+/* OCIDefineByName p�lda - [EMAIL PROTECTED] (980219) */
+
+$conn = OCILogon("scott","tiger");
+
+$stmt = OCIParse($conn,"select dolgozoid, dnev from dolgozok");
+
+/* ennek az ociexecute EL�TT KELL szerepelnie! */
+
+OCIDefineByName($stmt, "DOLGOZOID", $dolgozoid);
+OCIDefineByName($stmt, "DNEV", $dnev);
+
+OCIExecute($stmt);
+
+while (OCIFetch($stmt)) {
+ echo "Dolgoz� azonos�t�:" . $dolgozoid . "\n";
+ echo "Dolgoz� n�v:" . $dnev . "\n";
+}
+
+OCIFreeStatement($stmt);
+OCILogoff($conn);
+?>
+]]>
+ </programlisting>
+ </example>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocibindbyname">
+ <refnamediv>
+ <refname>OCIBindByName</refname>
+ <refpurpose>
+ PHP v�ltoz� k�t�se egy Oracle �rt�khez
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</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
+&</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>
+ Az <function>OCIBindByName</function> a <parameter>variable</parameter>
+ param�terben megadott PHP v�ltoz�t k�ti a <parameter>ph_name</parameter>
+ param�terben megadott Oracle �rt�kez (placeholder-hez). Ak�r bemeneti,
+ ak�r kimeneti �rt�kk�nt ker�l felhaszn�l�sra, ez fut�sid�ben d�l el,
+ �s a sz�ks�ges t�rol�si kapacit�s lefoglal�sra ker�l. A
+ <parameter>length</parameter> param�ter adja meg a k�t�s
+ maxim�lis m�ret�t. Ha a <parameter>length</parameter> param�tert -1
+ �rt�kkel adod meg, az <function>OCIBindByName</function> a
+ <parameter>variable</parameter> param�terben megadott v�ltoz�
+ aktu�lis hossz�t veszi maximum m�retnek.
+ </para>
+ <para>
+ Ha absztrakt adatt�pust kell k�tn�d (p�ld�ul LOB, ROWID vagy BFILE),
+ el�sz�r az <function>OCINewDescriptor</function> f�ggv�nyt kell
+ haszn�lnod. A <parameter>length</parameter> param�ternek nincs
+ jelent�s�ge absztrakt adatt�pusok haszn�latakor, mindenk�ppen -1
+ �rt�kre kell �ll�tani ebben az esetben. A
+ <parameter>type</parameter> param�ter adja meg az Oracle-nek,
+ hogy milyen le�r�t szeretn�l haszn�lni. Lehets�ges �rt�kek:
+ OCI_B_FILE (Binary-File), OCI_B_CFILE (Character-File),
+ OCI_B_CLOB (Character-LOB), OCI_B_BLOB (Binary-LOB)
+ �s OCI_B_ROWID (ROWID).
+ </para>
+ <example>
+ <title>OCIBindByName</title>
+ <programlisting>
+<![CDATA[
+<?php
+/* OCIBindByName p�lda - [EMAIL PROTECTED] (980221)
+ H�rom rekord felv�tele a "dolgozok" t�bl�ba, �s a ROWID
+ haszn�lata az adatok friss�t�s�re r�gt�n a felvitel ut�n.
+*/
+
+$conn = OCILogon("scott","tiger");
+
+$stmt = OCIParse($conn,"insert into dolgozok (dolgozoid, dnev) ".
+ "values (:dolgozoid,:dnev) ".
+ "returning ROWID into :rid");
+
+$adatok = array(1111 => "Larry", 2222 => "Bill", 3333 => "Jim");
+
+$rowid = OCINewDescriptor($conn, OCI_D_ROWID);
+
+OCIBindByName($stmt,":dolgozoid",&$dolgozoid, 32);
+OCIBindByName($stmt,":dnev", &$dnev, 32);
+OCIBindByName($stmt,":rid", &$rowid, -1, OCI_B_ROWID);
+
+$update = OCIParse($conn,
+ "update dolgozok set fizetes = :fizetes ".
+ "where ROWID = :rid");
+OCIBindByName($update,":rid", &$rowid, -1, OCI_B_ROWID);
+OCIBindByName($update,":fizetes", &$fizetes, 32);
+
+$fizetes = 10000;
+
+while (list($dolgozoid,$dnev) = each($adatok)) {
+ OCIExecute($stmt);
+ OCIExecute($update);
+}
+
+$rowid->free();
+
+OCIFreeStatement($update);
+OCIFreeStatement($stmt);
+
+$stmt = OCIParse($conn,"select * from dolgozok where dolgozoid in (1111,2222,3333)");
+OCIExecute($stmt);
+while (OCIFetchInto($stmt, &$tomb, OCI_ASSOC)) {
+ var_dump($tomb);
+}
+OCIFreeStatement($stmt);
+
+/* T�r�lj�k a "szemet�nket" a dolgozok t�bl�b�l.... */
+$stmt = OCIParse($conn,"delete from dolgozok where dolgozoid in (1111,2222,3333)");
+OCIExecute($stmt);
+OCIFreeStatement($stmt);
+
+OCILogoff($conn);
+?>
+]]>
+ </programlisting>
+ </example>
+ <warning>
+ <para>
+ Nem j� �tlet a "magic quotes" szolg�ltat�st, �s az
+ <function>OciBindByName</function> f�ggv�nyt egyszerre
+ haszn�lni, mivel semmilyen �talak�t�s nem sz�ks�ges a
+ v�ltoz�kon, �s b�rmilyen extra id�z�jel, ami az �rt�kekben
+ megjelenik az adatb�zisba ker�l. Az
+ <function>OciBindByName</function> nem tud k�l�nbs�get
+ tenni a kor�bban a karaktersorozatban l�v� �s a
+ "magic quotes" �talak�t�s sor�n beker�lt id�z�jelek
+ k�z�tt.
+ </para>
+ </warning>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocilogon">
+ <refnamediv>
+ <refname>OCILogon</refname>
+ <refpurpose>Oracle adatb�zis kapcsolat l�tes�t�se</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCILogon</methodname>
+ <methodparam><type>string</type><parameter>username</parameter></methodparam>
+ <methodparam><type>string</type><parameter>password</parameter></methodparam>
+ <methodparam
+choice="opt"><type>string</type><parameter>db</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Az <function>OCILogon</function> egy kapcsolat azonos�t�val t�r
+ vissza, amire a legt�bb OCI h�v�sban sz�ks�ged lesz. Az opcion�lis
+ harmadik param�ter vagy a helyi Oracle p�ld�ny nev�t adja meg,
+ vagy egy tnsnames.ora bejegyz�st, amihez csatlakozni szeretn�l.
+ Ha nem adod meg ezt a param�tert, a PHP az ORACLE_SID (Oracle
+ p�ld�ny) vagy a TWO_TASK (tnsnames.ora) k�rnyezeti v�ltoz�kat
+ haszn�lja, hogy eld�ntse melyik adatb�zishoz kell csatlakozni.
+ </para>
+ <para>
+ Az <function>OCILogon</function> �ltal visszaadott kapcsolatot
+ az aktu�lis oldalon megosztva haszn�lja a PHP. Ez azt jelenti,
+ hogy a tranzakci�k v�grehjat�sa vagy visszavon�sa minden nyitott
+ tranzakci�ra vonatkozik az adott oldalon, m�g akkor is, ha t�bb
+ adatb�zis kapcsolattal is rendelkezel.
+ </para>
+ <para>
+ Ez a p�lda bemutatja a kapcsolatok megoszt�s�t.
+ <example>
+ <title>OCILogon</title>
+ <programlisting>
+<![CDATA[
+<?php
+print "<HTML><PRE>";
+$db = "";
+
+$c1 = ocilogon("scott","tiger",$db);
+$c2 = ocilogon("scott","tiger",$db);
+
+function create_table($conn)
+{ $stmt = ociparse($conn,"create table scott.hello (proba varchar2(64))");
+ ociexecute($stmt);
+ echo $conn." t�bla l�trehozva\n\n";
+}
+
+function drop_table($conn)
+{ $stmt = ociparse($conn,"drop table scott.hello");
+ ociexecute($stmt);
+ echo $conn." t�bla t�r�lve\n\n";
+}
+
+function insert_data($conn)
+{ $stmt = ociparse($conn,"insert into scott.hello
+ values('$conn' || ' ' || to_char(sysdate,'DD-MON-YY HH24:MI:SS'))");
+ ociexecute($stmt,OCI_DEFAULT);
+ echo $conn." beilleszt�s v�grehajtva\n\n";
+}
+
+function delete_data($conn)
+{ $stmt = ociparse($conn,"delete from scott.hello");
+ ociexecute($stmt,OCI_DEFAULT);
+ echo $conn." t�rl�s v�grehajtva\n\n";
+}
+
+function commit($conn)
+{ ocicommit($conn);
+ echo $conn." tranzakci� v�grehajtva\n\n";
+}
+
+function rollback($conn)
+{ ocirollback($conn);
+ echo $conn." tranzakci� visszavonva\n\n";
+}
+
+function select_data($conn)
+{ $stmt = ociparse($conn,"select * from scott.hello");
+ ociexecute($stmt,OCI_DEFAULT);
+ echo $conn."----select v�grehajt�sa\n\n";
+ while (ocifetch($stmt))
+ echo $conn." <".ociresult($stmt,"PROBA").">\n\n";
+ echo $conn."----k�sz\n\n";
+}
+
+create_table($c1);
+insert_data($c1); // �j sor beilleszt�se c1 felhaszn�l�s�val
+insert_data($c2); // �j sor beilleszt�se c2 felhaszn�l�s�val
+
+select_data($c1); // Mindk�t insert eredm�ny�t megkapjuk
+select_data($c2);
+
+rollback($c1); // Visszavonjuk a c1-en v�gzett m�veletet
+
+select_data($c1); // Mindk�t m�veletet visszavontuk
+select_data($c2);
+
+insert_data($c2); // Sor beilleszt�se c2-vel
+commit($c2); // Tranzakci� v�grehajt�sa c2-vel
+
+select_data($c1); // A c2 beilleszt�s eredm�ny�t visszakapjuk
+
+delete_data($c1); // A c1-el t�r�lj�k a sorokat
+select_data($c1); // Egy sor sincs
+select_data($c2); // Egy sor sincs
+commit($c1); // A c1-el v�grehajtjuk a tranzakci�t
+
+select_data($c1); // Egy sor sincs
+select_data($c2); // Egy sor sincs
+
+drop_table($c1);
+print "</PRE></HTML>";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <simpara>
+ L�sd m�g <function>OCIPLogon</function> �s
+ <function>OCINLogon</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ociplogon">
+ <refnamediv>
+ <refname>OCIPLogon</refname>
+ <refpurpose>Oracle adatb�ziscsatlakoz�s �lland� kapcsolattal</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIPLogon</methodname>
+ <methodparam><type>string</type><parameter>username</parameter></methodparam>
+ <methodparam><type>string</type><parameter>password</parameter></methodparam>
+ <methodparam
+choice="opt"><type>string</type><parameter>db</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Az <function>OCIPLogon</function> egy �lland� (persistent)
+ adatb�zis kapcsolatot hoz l�tre az Oracle8 adatb�zishoz, �s
+ bejelentkezik. Az opcion�lis harmadik param�ter vagy a helyi
+ Oracle p�ld�ny nev�t adja meg, vagy egy tnsnames.ora bejegyz�st,
+ amihez csatlakozni szeretn�l. Ha nem adod meg ezt a param�tert,
+ a PHP az ORACLE_SID (Oracle p�ld�ny) vagy a TWO_TASK (tnsnames.ora)
+ k�rnyezeti v�ltoz�kat haszn�lja, hogy eld�ntse melyik
+ adatb�zishoz kell csatlakozni.
+ </para>
+ <simpara>
+ L�sd m�g <function>OCILogon</function> �s
+ <function>OCINLogon</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocinlogon">
+ <refnamediv>
+ <refname>OCINLogon</refname>
+ <refpurpose>�j Oracle adatb�zis kapcsolat l�trehoz�sa</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCINLogon</methodname>
+ <methodparam><type>string</type><parameter>username</parameter></methodparam>
+ <methodparam><type>string</type><parameter>password</parameter></methodparam>
+ <methodparam
+choice="opt"><type>string</type><parameter>db</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Az <function>OCINLogon</function> egy �j Oracle 8 adatb�zis
+ kapcsolatot hoz l�tre, �s bejelentkezik. Az opcion�lis
+ harmadik param�ter vagy a helyi Oracle p�ld�ny nev�t adja meg,
+ vagy egy tnsnames.ora bejegyz�st, amihez csatlakozni szeretn�l.
+ Ha nem adod meg ezt a param�tert, a PHP az ORACLE_SID (Oracle
+ p�ld�ny) vagy a TWO_TASK (tnsnames.ora) k�rnyezeti v�ltoz�kat
+ haszn�lja, hogy eld�ntse melyik adatb�zishoz kell csatlakozni.
+ </para>
+ <para>
+ Az <function>OCINLogon</function> mindenk�ppen egy �j
+ kapcsolatot hoz l�tre. Erre akkor van sz�ks�ged, ha el
+ kell k�l�n�tened a tranzakci�idat egym�st�l. Alap�rtelmez�sben
+ a kapcsolatokat a PHP megosztja egy oldalon bel�l, ha az
+ <function>OCILogon</function> f�ggv�nyt haszn�lod. Az
+ <function>OCIPLogon</function> haszn�lata eset�n pedig m�r
+ a web szerver process szintj�n �rv�nyes�l a megoszt�s.
+ Ha t�bb kapcsolatod van az <function>OCINLogon</function>
+ f�ggv�nnyel megnyitva, minden tranzakci� v�grehajt�s �s
+ visszavon�s cska az adott kapcsolatra vonatkozik.
+ </para>
+ <para>
+ A k�vetkez� p�lda bemutatja a kapcsolatok elk�l�n�l�s�t.
+ <example>
+ <title>OCINLogon</title>
+ <programlisting>
+<![CDATA[
+<?php
+print "<HTML><PRE>";
+$db = "";
+
+$c1 = ocilogon("scott","tiger",$db);
+$c2 = ocinlogon("scott","tiger",$db);
+
+function create_table($conn)
+{ $stmt = ociparse($conn,"create table scott.hello (proba varchar2(64))");
+ ociexecute($stmt);
+ echo $conn." t�bla l�trehozva\n\n";
+}
+
+function drop_table($conn)
+{ $stmt = ociparse($conn,"drop table scott.hello");
+ ociexecute($stmt);
+ echo $conn." t�bla t�r�lve\n\n";
+}
+
+function insert_data($conn)
+{ $stmt = ociparse($conn,"insert into scott.hello
+ values('$conn' || ' ' || to_char(sysdate,'DD-MON-YY HH24:MI:SS'))");
+ ociexecute($stmt,OCI_DEFAULT);
+ echo $conn." beilleszt�s v�grehajtva\n\n";
+}
+
+function delete_data($conn)
+{ $stmt = ociparse($conn,"delete from scott.hello");
+ ociexecute($stmt,OCI_DEFAULT);
+ echo $conn." t�rl�s v�grehajtva\n\n";
+}
+
+function commit($conn)
+{ ocicommit($conn);
+ echo $conn." tranzakci� v�grehajtva\n\n";
+}
+
+function rollback($conn)
+{ ocirollback($conn);
+ echo $conn." tranzakci� visszavonva\n\n";
+}
+
+function select_data($conn)
+{ $stmt = ociparse($conn,"select * from scott.hello");
+ ociexecute($stmt,OCI_DEFAULT);
+ echo $conn."----select v�grehajt�sa\n\n";
+ while (ocifetch($stmt))
+ echo $conn." <".ociresult($stmt,"PROBA").">\n\n";
+ echo $conn."----k�sz\n\n";
+}
+
+create_table($c1);
+insert_data($c1);
+
+select_data($c1);
+select_data($c2);
+
+rollback($c1);
+
+select_data($c1);
+select_data($c2);
+
+insert_data($c2);
+commit($c2);
+
+select_data($c1);
+
+delete_data($c1);
+select_data($c1);
+select_data($c2);
+commit($c1);
+
+select_data($c1);
+select_data($c2);
+
+drop_table($c1);
+print "</PRE></HTML>";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <simpara>
+ L�sd m�g <function>OCILogon</function> �s
+ <function>OCIPLogon</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocilogoff">
+ <refnamediv>
+ <refname>OCILogOff</refname>
+ <refpurpose>Oracle kapcsolat bont�sa</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCILogOff</methodname>
+ <methodparam><type>int</type><parameter>connection</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ Az <function>OCILogOff</function> f�ggv�ny lez�r
+ egy Oracle kapcsolatot.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ociexecute">
+ <refnamediv>
+ <refname>OCIExecute</refname>
+ <refpurpose>Execute a statement</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIExecute</methodname>
+ <methodparam><type>int</type><parameter>statement</parameter></methodparam>
+ <methodparam
+choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIExecute</function> executes a previously parsed
+ statement. (see <function>OCIParse</function>). The optional
+ <parameter>mode</parameter> allows you to specify the
+ execution-mode (default is OCI_COMMIT_ON_SUCCESS). If you don't
+ want statements to be committed automatically specify OCI_DEFAULT as
+ your mode.
+ </para>
+ <para>
+ &return.success;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicommit">
+ <refnamediv>
+ <refname>OCICommit</refname>
+ <refpurpose>Commits outstanding transactions</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCICommit</methodname>
+ <methodparam><type>int</type><parameter>connection</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCICommit</function> commits all outstanding statements
+ for Oracle connection <parameter>connection</parameter>.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocirollback">
+ <refnamediv>
+ <refname>OCIRollback</refname>
+ <refpurpose>Rolls back outstanding transactions</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIRollback</methodname>
+ <methodparam><type>int</type><parameter>connection</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIRollback</function> rolls back all outstanding
+ statements for Oracle connection <parameter>connection</parameter>.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocinewdescriptor">
+ <refnamediv>
+ <refname>OCINewDescriptor</refname>
+ <refpurpose>
+ Initialize a new empty descriptor LOB/FILE (LOB is default)
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCINewDescriptor</methodname>
+ <methodparam><type>int</type><parameter>connection</parameter></methodparam>
+ <methodparam
+choice="opt"><type>int</type><parameter>type</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCINewDescriptor</function> Allocates storage to hold
+ descriptors or LOB locators. Valid values for the valid
+ <parameter>type</parameter> are OCI_D_FILE, OCI_D_LOB, OCI_D_ROWID.
+ 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.
+ </para>
+ <example>
+ <title>OCINewDescriptor</title>
+ <programlisting>
+<![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);
+ print "$nrows\n";
+ if ( ($nrows % $commitsize) == 0 ) {
+ OCICommit($conn);
+ }
+ }
+ $nrows = OCIRowCount($stmt);
+ print "$nrows deleted...\n";
+ OCIFreeStatement($stmt);
+ OCILogoff($conn);
+?>
+]]>
+ </programlisting>
+ <programlisting>
+<![CDATA[
+<?php
+ /* This script demonstrates file upload to LOB columns
+ * The formfield used for this example looks like this
+ * <form action="upload.php3" method="post" enctype="multipart/form-data">
+ * <input type="file" name="lob_upload">
+ * ...
+ */
+ if(!isset($lob_upload) || $lob_upload == 'none'){
+?>
+<form action="upload.php3" method="post" enctype="multipart/form-data">
+Upload file: <input type="file" name="lob_upload"><br>
+<input type="submit" value="Upload"> - <input type="reset">
+</form>
+<?php
+ } else {
+ // $lob_upload contains the temporary filename of the uploaded file
+ $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>OCINewDescriptor</title>
+ <programlisting>
+<![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>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocirowcount">
+ <refnamediv>
+ <refname>OCIRowCount</refname>
+ <refpurpose>Gets the number of affected rows</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIRowCount</methodname>
+ <methodparam><type>int</type><parameter>statement</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIRowCount</function> returns the number of rows affected
+ for eg update-statements. This function will not tell you the number
+ of rows that a select will return!</para>
+ <para>
+ <example>
+ <title>OCIRowCount</title>
+ <programlisting>
+<![CDATA[
+<?php
+ print "<HTML><PRE>";
+ $conn = OCILogon("scott","tiger");
+ $stmt = OCIParse($conn,"create table emp2 as select * from emp");
+ OCIExecute($stmt);
+ print OCIRowCount($stmt) . " rows inserted.<BR>";
+ OCIFreeStatement($stmt);
+ $stmt = OCIParse($conn,"delete from emp2");
+ OCIExecute($stmt);
+ print OCIRowCount($stmt) . " rows deleted.<BR>";
+ OCICommit($conn);
+ OCIFreeStatement($stmt);
+ $stmt = OCIParse($conn,"drop table emp2");
+ OCIExecute($stmt);
+ OCIFreeStatement($stmt);
+ OCILogOff($conn);
+ print "</PRE></HTML>";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocinumcols">
+ <refnamediv>
+ <refname>OCINumCols</refname>
+ <refpurpose>
+ Return the number of result columns in a statement
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCINumCols</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCINumCols</function> returns the number of columns in a
+ statement
+ </para>
+ <example>
+ <title>OCINumCols</title>
+ <programlisting>
+<![CDATA[
+<?php
+ print "<HTML><PRE>\n";
+ $conn = OCILogon("scott", "tiger");
+ $stmt = OCIParse($conn,"select * from emp");
+ OCIExecute($stmt);
+ while ( OCIFetch($stmt) ) {
+ print "\n";
+ $ncols = OCINumCols($stmt);
+ for ( $i = 1; $i <= $ncols; $i++ ) {
+ $column_name = OCIColumnName($stmt,$i);
+ $column_value = OCIResult($stmt,$i);
+ print $column_name . ': ' . $column_value . "\n";
+ }
+ print "\n";
+ }
+ OCIFreeStatement($stmt);
+ OCILogoff($conn);
+ print "</PRE>";
+ print "</HTML>\n";
+?>
+]]>
+ </programlisting>
+ </example>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ociresult">
+ <refnamediv>
+ <refname>OCIResult</refname>
+ <refpurpose>Returns column value for fetched row</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>mixed</type><methodname>OCIResult</methodname>
+ <methodparam><type>int</type><parameter>statement</parameter></methodparam>
+ <methodparam><type>mixed</type><parameter>column</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIResult</function> returns the data for column
+ <parameter>column</parameter> in the current row (see
+ <function>OCIFetch</function>).<function>OCIResult</function> will
+ return everything as strings except for abstract types (ROWIDs,
+ LOBs and FILEs).
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocifetch">
+ <refnamediv>
+ <refname>OCIFetch</refname>
+ <refpurpose>Fetches the next row into result-buffer</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIFetch</methodname>
+ <methodparam><type>int</type><parameter>statement</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIFetch</function> fetches the next row (for SELECT
+ statements) into the internal result-buffer.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocifetchinto">
+ <refnamediv>
+ <refname>OCIFetchInto</refname>
+ <refpurpose>Fetches the next row into result-array</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIFetchInto</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>array &</type><parameter>result</parameter></methodparam>
+ <methodparam
+choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIFetchInto</function> fetches the next row (for SELECT
+ statements) into the <parameter>result</parameter> array.
+ <function>OCIFetchInto</function> will overwrite the previous
+ content of <parameter>result</parameter>. By default
+ <parameter>result</parameter> will contain a zero-based array of all
+ columns that are not &null;.
+ </para>
+ <para>
+ The <parameter>mode</parameter> 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:
+ <simplelist>
+ <member>
+ <literal>OCI_ASSOC</literal> Return an associative array.
+ </member>
+ <member>
+ <literal>OCI_NUM</literal> Return an numbered array starting with
+ zero. (DEFAULT)
+ </member>
+ <member>
+ <literal>OCI_RETURN_NULLS</literal> Return empty columns.
+ </member>
+ <member>
+ <literal>OCI_RETURN_LOBS</literal> Return the value of a LOB
+ instead of the descriptor.
+ </member>
+ </simplelist>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocifetchstatement">
+ <refnamediv>
+ <refname>OCIFetchStatement</refname>
+ <refpurpose>Fetch all rows of result data into an array.</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIFetchStatement</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>array
+&</type><parameter>variable</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIFetchStatement</function> fetches all the rows from a
+ result into a user-defined array.
+ <function>OCIFetchStatement</function> returns the number of rows
+ fetched.
+ </para>
+ <example>
+ <title>OCIFetchStatement</title>
+ <programlisting>
+<![CDATA[
+<?php
+/* OCIFetchStatement example [EMAIL PROTECTED] (990624) */
+
+$conn = OCILogon("scott","tiger");
+
+$stmt = OCIParse($conn,"select * from emp");
+
+OCIExecute($stmt);
+
+$nrows = OCIFetchStatement($stmt,$results);
+if ( $nrows > 0 ) {
+ print "<TABLE BORDER=\"1\">\n";
+ print "<TR>\n";
+ while ( list( $key, $val ) = each( $results ) ) {
+ print "<TH>$key</TH>\n";
+ }
+ print "</TR>\n";
+
+ for ( $i = 0; $i < $nrows; $i++ ) {
+ reset($results);
+ print "<TR>\n";
+ while ( $column = each($results) ) {
+ $data = $column['value'];
+ print "<TD>$data[$i]</TD>\n";
+ }
+ print "</TR>\n";
+ }
+ print "</TABLE>\n";
+} else {
+ echo "No data found<BR>\n";
+}
+print "$nrows Records Selected<BR>\n";
+
+OCIFreeStatement($stmt);
+OCILogoff($conn);
+?>
+]]>
+ </programlisting>
+ </example>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicolumnisnull">
+ <refnamediv>
+ <refname>OCIColumnIsNULL</refname>
+ <refpurpose>test whether a result column is &null;</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIColumnIsNULL</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>mixed</type><parameter>column</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIColumnIsNULL</function> returns &true; if the returned
+ column <parameter>column</parameter> in the result from the
+ statement <parameter>stmt</parameter> is &null;. You can either use
+ the column-number (1-Based) or the column-name for the
+ <parameter>col</parameter> parameter.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicolumnname">
+ <refnamediv>
+ <refname>OCIColumnName</refname>
+ <refpurpose>Returns the name of a column.</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCIColumnName</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>int</type><parameter>col</parameter></methodparam>
+ </methodsynopsis>
+ <simpara>
+ <function>OCIColumnName</function> returns the name of the column
+ corresponding to the column number (1-based) that is passed in.
+ </simpara>
+ <para>
+ <example>
+ <title>OCIColumnName</title>
+ <programlisting>
+<![CDATA[
+<?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";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <simpara>
+ See also <function>OCINumCols</function>,
+ <function>OCIColumnType</function>,
+ and <function>OCIColumnSize</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicolumnsize">
+ <refnamediv>
+ <refname>OCIColumnSize</refname>
+ <refpurpose>return result column size</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIColumnSize</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>mixed</type><parameter>column</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIColumnSize</function> 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
+ <parameter>col</parameter> parameter.
+ </para>
+ <para>
+ <example>
+ <title>OCIColumnSize</title>
+ <programlisting>
+<![CDATA[
+<?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>";
+ }
+ print "</TABLE>";
+ OCIFreeStatement($stmt);
+ OCILogoff($conn);
+ print "</PRE>";
+ print "</HTML>\n";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <simpara>
+ See also <function>OCINumCols</function>,
+ <function>OCIColumnName</function>, and
+ <function>OCIColumnSize</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicolumntype">
+ <refnamediv>
+ <refname>OCIColumnType</refname>
+ <refpurpose>Returns the data type of a column.</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>mixed</type><methodname>OCIColumnType</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>int</type><parameter>col</parameter></methodparam>
+ </methodsynopsis>
+ <simpara>
+ <function>OCIColumnType</function> returns the data type of the
+ column corresponding to the column number (1-based) that is passed
+ in.
+ </simpara>
+ <para>
+ <example>
+ <title>OCIColumnType</title>
+ <programlisting>
+<![CDATA[
+<?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";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <simpara>
+ See also <function>OCINumCols</function>,
+ <function>OCIColumnName</function>,
+ and <function>OCIColumnSize</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ociserverversion">
+ <refnamediv>
+ <refname>OCIServerVersion</refname>
+ <refpurpose>Return a string containing server version
+ information.</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCIServerVersion</methodname>
+ <methodparam><type>int</type><parameter>conn</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <example>
+ <title>OCIServerVersion</title>
+ <programlisting>
+<![CDATA[
+<?php
+ $conn = OCILogon("scott","tiger");
+ print "Server Version: " . OCIServerVersion($conn);
+ OCILogOff($conn);
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocistatementtype">
+ <refnamediv>
+ <refname>OCIStatementType</refname>
+ <refpurpose>Return the type of an OCI statement.</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCIStatementType</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIStatementType</function> returns one of the following
+ values:
+ <orderedlist>
+ <listitem><simpara> "SELECT"</simpara></listitem>
+ <listitem><simpara> "UPDATE"</simpara></listitem>
+ <listitem><simpara> "DELETE"</simpara></listitem>
+ <listitem><simpara> "INSERT"</simpara></listitem>
+ <listitem><simpara> "CREATE"</simpara></listitem>
+ <listitem><simpara> "DROP"</simpara></listitem>
+ <listitem><simpara> "ALTER"</simpara></listitem>
+ <listitem><simpara> "BEGIN"</simpara></listitem>
+ <listitem><simpara> "DECLARE"</simpara></listitem>
+ <listitem><simpara> "UNKNOWN"</simpara></listitem>
+ </orderedlist></para>
+ <para>
+ <example>
+ <title>Code examples</title>
+ <programlisting>
+<![CDATA[
+<?php
+ print "<HTML><PRE>";
+ $conn = OCILogon("scott","tiger");
+ $sql = "delete from emp where deptno = 10";
+
+ $stmt = OCIParse($conn,$sql);
+ if ( OCIStatementType($stmt) == "DELETE" ) {
+ die "You are not allowed to delete from this table<BR>";
+ }
+
+ OCILogoff($conn);
+ print "</PRE></HTML>";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocinewcursor">
+ <refnamediv>
+ <refname>OCINewCursor</refname>
+ <refpurpose>
+ Return a new cursor (Statement-Handle) - use to bind ref-cursors.
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCINewCursor</methodname>
+ <methodparam><type>int</type><parameter>conn</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCINewCursor</function> allocates a new statement handle
+ on the specified connection.
+ </para>
+ <para>
+ <example>
+ <title>Using a REF CURSOR from a stored procedure</title>
+ <programlisting>
+<![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>Using a REF CURSOR in a select statement</title>
+ <programlisting>
+<![CDATA[
+<?php
+print "<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);
+print "<TABLE BORDER=\"1\">";
+print "<TR>";
+print "<TH>DEPT NAME</TH>";
+print "<TH>DEPT #</TH>";
+print "<TH># EMPLOYEES</TH>";
+print "</TR>";
+
+while (OCIFetchInto($stmt,&$data,OCI_ASSOC)) {
+ print "<TR>";
+ $dname = $data["DNAME"];
+ $deptno = $data["DEPTNO"];
+ print "<TD>$dname</TD>";
+ print "<TD>$deptno</TD>";
+ ociexecute($data[ "EMPCNT" ]);
+ while (OCIFetchInto($data[ "EMPCNT" ],&$subdata,OCI_ASSOC)) {
+ $num_emps = $subdata["NUM_EMPS"];
+ print "<TD>$num_emps</TD>";
+ }
+ print "</TR>";
+}
+print "</TABLE>";
+print "</BODY></HTML>";
+OCIFreeStatement($stmt);
+OCILogoff($conn);
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocifreestatement">
+ <refnamediv>
+ <refname>OCIFreeStatement</refname>
+ <refpurpose>
+ Free all resources associated with a statement.
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIFreeStatement</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIFreeStatement</function> returns &true; if successful,
+ or &false; if unsuccessful.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocifreecursor">
+ <refnamediv>
+ <refname>OCIFreeCursor</refname>
+ <refpurpose>
+ Free all resources associated with a cursor.
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIFreeCursor</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIFreeCursor</function> returns &true; if successful, or
+ &false; if unsuccessful.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocifreedesc">
+ <refnamediv>
+ <refname>OCIFreeDesc</refname>
+ <refpurpose>Deletes a large object descriptor.</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIFreeDesc</methodname>
+ <methodparam><type>object</type><parameter>lob</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>OCIFreeDesc</function> returns &true; if successful, or
+ &false; if unsuccessful.
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ociparse">
+ <refnamediv>
+ <refname>OCIParse</refname>
+ <refpurpose>Parse a query and return a statement</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIParse</methodname>
+ <methodparam><type>int</type><parameter>conn</parameter></methodparam>
+ <methodparam><type>string</type><parameter>query</parameter></methodparam>
+ </methodsynopsis>
+ <simpara>
+ <function>OCIParse</function> parses the
+ <parameter>query</parameter> using <parameter>conn</parameter>.
+ It returns the statement identity if the query is valid, &false; if
+ not. The <parameter>query</parameter> can be any valid SQL
+ statement or PL/SQL block.
+ </simpara>
+ </refsect1>
+ </refentry>
+ <refentry id="function.ocierror">
+ <refnamediv>
+ <refname>OCIError</refname>
+ <refpurpose>Return the last error of stmt|conn|global.
+ If no error happened returns &false;.
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>array</type><methodname>OCIError</methodname>
+ <methodparam
+choice="opt"><type>int</type><parameter>stmt|conn|global</parameter></methodparam>
+ </methodsynopsis>
+ <simpara>
+ <function>OCIError</function> returns the last error found. If
+ the optional <parameter>stmt|conn|global</parameter> is not
+ provided, the last error encountered is returned. If no error is
+ found, <function>OCIError</function> returns
+ &false;. <function>OCIError</function> returns the error as an
+ associative array. In this array, <parameter>code</parameter>
+ consists the oracle error code and <parameter>message</parameter>
+ the oracle errorstring.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ociinternaldebug">
+ <refnamediv>
+ <refname>OCIInternalDebug</refname>
+ <refpurpose>
+ Enables or disables internal debug output. By default it is
+ disabled
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>void</type><methodname>OCIInternalDebug</methodname>
+ <methodparam><type>int</type><parameter>onoff</parameter></methodparam>
+ </methodsynopsis>
+ <simpara>
+ <function>OCIInternalDebug</function> enables internal debug
+ output. Set <parameter>onoff</parameter> to 0 to turn debug
+ output off, 1 to turn it on.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicancel">
+ <refnamediv>
+ <refname>OCICancel</refname>
+ <refpurpose>Cancel reading from cursor</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCICancel</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ </methodsynopsis>
+ <simpara>
+ If you do not want read more data from a cursor, then call
+ <function>OCICancel</function>.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocisetprefetch">
+ <refnamediv>
+ <refname>OCISetPrefetch</refname>
+ <refpurpose>sets number of rows to be prefetched</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCISetPrefetch</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>int</type><parameter>rows</parameter></methodparam>
+ </methodsynopsis>
+ <simpara>
+ Sets the number of top level rows to be prefetched. The default value is 1 row.
+ </simpara>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ociwritelobtofile">
+ <refnamediv>
+ <refname>OCIWriteLobToFile</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>void</type><methodname>OCIWriteLobToFile</methodname>
+ <methodparam><type>object</type><parameter>lob</parameter></methodparam>
+ <methodparam
+choice="opt"><type>string</type><parameter>filename</parameter></methodparam>
+ <methodparam
+choice="opt"><type>int</type><parameter>start</parameter></methodparam>
+ <methodparam
+choice="opt"><type>int</type><parameter>lenght</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocisavelobfile">
+ <refnamediv>
+ <refname>OCISaveLobFile</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCISaveLobFile</methodname>
+ <methodparam><type>object</type><parameter>lob</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocisavelob">
+ <refnamediv>
+ <refname>OCISaveLob</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCISaveLob</methodname>
+ <methodparam><type>object</type><parameter>lob</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ociloadlob">
+ <refnamediv>
+ <refname>OCILoadLob</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCILoadLob</methodname>
+ <methodparam><type>object</type><parameter>lob</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicolumnscale">
+ <refnamediv>
+ <refname>OCIColumnScale</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIColumnScale</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>int</type><parameter>col</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicolumnprecision">
+ <refnamediv>
+ <refname>OCIColumnPrecision</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>int</type><methodname>OCIColumnPrecision</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>int</type><parameter>col</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicolumntyperaw">
+ <refnamediv>
+ <refname>OCIColumnTypeRaw</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>mixed</type><methodname>OCIColumnTypeRaw</methodname>
+ <methodparam><type>int</type><parameter>stmt</parameter></methodparam>
+ <methodparam><type>int</type><parameter>col</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocinewcollection">
+ <refnamediv>
+ <refname>OCINewCollection</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</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>
+
+ <refentry id="function.ocifreecollection">
+ <refnamediv>
+ <refname>OCIFreeCollection</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCIFreeCollection</methodname>
+ <methodparam><type>object</type><parameter>lob</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicollassign">
+ <refnamediv>
+ <refname>OCICollAssign</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCICollAssign</methodname>
+ <methodparam><type>object</type><parameter>collection</parameter></methodparam>
+ <methodparam><type>object</type><parameter>object</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicollappend">
+ <refnamediv>
+ <refname>OCICollAppend</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCICollAppend</methodname>
+ <methodparam><type>object</type><parameter>collection</parameter></methodparam>
+ <methodparam><type>object</type><parameter>object</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicollassignelem">
+ <refnamediv>
+ <refname>OCICollAssignElem</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCICollAssignElem</methodname>
+ <methodparam><type>object</type><parameter>collection</parameter></methodparam>
+ <methodparam><type>string</type><parameter>ndx</parameter></methodparam>
+ <methodparam><type>string</type><parameter>val</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicollgetelem">
+ <refnamediv>
+ <refname>OCICollGetElem</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCICollGetElem</methodname>
+ <methodparam><type>object</type><parameter>collection</parameter></methodparam>
+ <methodparam><type>string</type><parameter>ndx</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicollmax">
+ <refnamediv>
+ <refname>OCICollMax</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCICollMax</methodname>
+ <methodparam><type>object</type><parameter>collection</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicollsize">
+ <refnamediv>
+ <refname>OCICollSize</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCICollSize</methodname>
+ <methodparam><type>object</type><parameter>collection</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.ocicolltrim">
+ <refnamediv>
+ <refname>OCICollTrim</refname>
+ <refpurpose>[Eddig] nem dokument�lt</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Le�r�s</title>
+ <methodsynopsis>
+ <type>string</type><methodname>OCICollTrim</methodname>
+ <methodparam><type>object</type><parameter>collection</parameter></methodparam>
+ <methodparam><type>int</type><parameter>num</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ &warn.undocumented.func;
+ </para>
+ </refsect1>
+ </refentry>
+
+ </reference>
+
+<!-- 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
+-->
+