Merge branch 'master' of git://github.com/openemr/openemr
[openemr.git] / library / adodb / drivers / adodb-borland_ibase.inc.php
blob4030c7189beacb5d526e2c04768ef0f21cb06764
1 <?php
2 /*
3 V4.20 22 Feb 2004 (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
4 Released under both BSD license and Lesser GPL library license.
5 Whenever there is any discrepancy between the two licenses,
6 the BSD license will take precedence.
7 Set tabs to 4 for best viewing.
9 Latest version is available at http://php.weblogs.com/
11 Support Borland Interbase 6.5 and later
15 include_once(ADODB_DIR."/drivers/adodb-ibase.inc.php");
17 class ADODB_borland_ibase extends ADODB_ibase {
18 var $databaseType = "borland_ibase";
20 function ADODB_borland_ibase()
22 $this->ADODB_ibase();
25 function ServerInfo()
27 $arr['dialect'] = $this->dialect;
28 switch($arr['dialect']) {
29 case '':
30 case '1': $s = 'Interbase 6.5, Dialect 1'; break;
31 case '2': $s = 'Interbase 6.5, Dialect 2'; break;
32 default:
33 case '3': $s = 'Interbase 6.5, Dialect 3'; break;
35 $arr['version'] = '6.5';
36 $arr['description'] = $s;
37 return $arr;
40 // Note that Interbase 6.5 uses ROWS instead - don't you love forking wars!
41 // SELECT col1, col2 FROM table ROWS 5 -- get 5 rows
42 // SELECT col1, col2 FROM TABLE ORDER BY col1 ROWS 3 TO 7 -- first 5 skip 2
43 // Firebird uses
44 // SELECT FIRST 5 SKIP 2 col1, col2 FROM TABLE
45 function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$secs2cache=0)
47 if ($nrows > 0) {
48 if ($offset <= 0) $str = " ROWS $nrows ";
49 else {
50 $a = $offset+1;
51 $b = $offset+$nrows;
52 $str = " ROWS $a TO $b";
54 } else {
55 // ok, skip
56 $a = $offset + 1;
57 $str = " ROWS $a TO 999999999"; // 999 million
59 $sql .= $str;
61 return ($secs2cache) ?
62 $this->CacheExecute($secs2cache,$sql,$inputarr)
64 $this->Execute($sql,$inputarr);
70 class ADORecordSet_borland_ibase extends ADORecordSet_ibase {
72 var $databaseType = "borland_ibase";
74 function ADORecordSet_borland_ibase($id,$mode=false)
76 $this->ADORecordSet_ibase($id,$mode);