Documentation TYPO3 par Ameos

testoci8.php

00001 <html>
00002 <body>
00003 <?php
00004 /* 
00005 V4.80 8 Mar 2006  (c) 2000-2006 John Lim (jlim@natsoft.com.my). All rights reserved.
00006   Released under both BSD license and Lesser GPL library license. 
00007   Whenever there is any discrepancy between the two licenses, 
00008   the BSD license will take precedence. 
00009   Set tabs to 4 for best viewing.
00010         
00011   Latest version is available at http://adodb.sourceforge.net
00012 */
00013 error_reporting(63);
00014 include("../adodb.inc.php");
00015 include("../tohtml.inc.php");
00016 
00017 if (0) {
00018         $db = ADONewConnection('oci8po');
00019         
00020         $db->PConnect('','scott','natsoft');
00021         if (!empty($testblob)) {
00022                 $varHoldingBlob = 'ABC DEF GEF John TEST';
00023                 $num = time()%10240;
00024                 // create table atable (id integer, ablob blob);
00025                 $db->Execute('insert into ATABLE (id,ablob) values('.$num.',empty_blob())');
00026                 $db->UpdateBlob('ATABLE', 'ablob', $varHoldingBlob, 'id='.$num, 'BLOB');
00027                 
00028                 $rs = &$db->Execute('select * from atable');
00029                 
00030                 if (!$rs) die("Empty RS");
00031                 if ($rs->EOF) die("EOF RS");
00032                 rs2html($rs);
00033         }
00034         $stmt = $db->Prepare('select * from adoxyz where id=?');
00035         for ($i = 1; $i <= 10; $i++) {
00036         $rs = &$db->Execute(
00037                 $stmt,
00038                 array($i));
00039                         
00040                 if (!$rs) die("Empty RS");
00041                 if ($rs->EOF) die("EOF RS");
00042                 rs2html($rs);
00043         }
00044 }
00045 if (1) {
00046         $db = ADONewConnection('oci8');
00047         $db->PConnect('','scott','natsoft');
00048         $db->debug = true;
00049         $db->Execute("delete from emp where ename='John'");
00050         print $db->Affected_Rows().'<BR>';
00051         $stmt = &$db->Prepare('insert into emp (empno, ename) values (:empno, :ename)');
00052         $rs = $db->Execute($stmt,array('empno'=>4321,'ename'=>'John'));
00053         // prepare not quite ready for prime time
00054         //$rs = $db->Execute($stmt,array('empno'=>3775,'ename'=>'John'));
00055         if (!$rs) die("Empty RS");
00056         
00057         $db->setfetchmode(ADODB_FETCH_NUM);
00058         
00059         $vv = 'A%';
00060         $stmt = $db->PrepareSP("BEGIN adodb.open_tab2(:rs,:tt); END;",true);
00061         $db->OutParameter($stmt, $cur, 'rs', -1, OCI_B_CURSOR);
00062         $db->OutParameter($stmt, $vv, 'tt');
00063         $rs = $db->Execute($stmt);
00064         while (!$rs->EOF) {
00065                 adodb_pr($rs->fields);
00066                 $rs->MoveNext();
00067         }
00068         echo " val = $vv";
00069 
00070 }
00071 
00072 if (0) {
00073         $db = ADONewConnection('odbc_oracle');
00074         if (!$db->PConnect('local_oracle','scott','tiger')) die('fail connect');
00075         $db->debug = true;
00076         $rs = &$db->Execute(
00077                 'select * from adoxyz where firstname=? and trim(lastname)=?',
00078                 array('first'=>'Caroline','last'=>'Miranda'));
00079         if (!$rs) die("Empty RS");
00080         if ($rs->EOF) die("EOF RS");
00081         rs2html($rs);
00082 }
00083 ?>


Généré par Les spécialistes TYPO3 avec  doxygen 1.4.6