[2] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | V4.51 29 July 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. |
---|
| 8 | |
---|
| 9 | Latest version is available at http://adodb.sourceforge.net |
---|
| 10 | |
---|
| 11 | SAPDB data driver. Requires ODBC. |
---|
| 12 | |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | // security - hide paths |
---|
| 16 | if (!defined('ADODB_DIR')) die(); |
---|
| 17 | |
---|
| 18 | if (!defined('_ADODB_ODBC_LAYER')) { |
---|
| 19 | include(ADODB_DIR."/drivers/adodb-odbc.inc.php"); |
---|
| 20 | } |
---|
| 21 | if (!defined('ADODB_SAPDB')){ |
---|
| 22 | define('ADODB_SAPDB',1); |
---|
| 23 | |
---|
| 24 | class ADODB_SAPDB extends ADODB_odbc { |
---|
| 25 | var $databaseType = "sapdb"; |
---|
| 26 | var $concat_operator = '||'; |
---|
| 27 | var $sysDate = 'DATE'; |
---|
| 28 | var $sysTimeStamp = 'TIMESTAMP'; |
---|
| 29 | var $fmtDate = "\\D\\A\\T\\E('Y-m-d')"; /// used by DBDate() as the default date format used by the database |
---|
| 30 | var $fmtTimeStamp = "\\T\\I\\M\\E\\S\\T\\A\\M\\P('Y-m-d','H:i:s')"; /// used by DBTimeStamp as the default timestamp fmt. |
---|
| 31 | |
---|
| 32 | function ADODB_SAPDB() |
---|
| 33 | { |
---|
| 34 | //if (strncmp(PHP_OS,'WIN',3) === 0) $this->curmode = SQL_CUR_USE_ODBC; |
---|
| 35 | $this->ADODB_odbc(); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | /* |
---|
| 39 | SelectLimit implementation problems: |
---|
| 40 | |
---|
| 41 | The following will return random 10 rows as order by performed after "WHERE rowno<10" |
---|
| 42 | which is not ideal... |
---|
| 43 | |
---|
| 44 | select * from table where rowno < 10 order by 1 |
---|
| 45 | |
---|
| 46 | This means that we have to use the adoconnection base class SelectLimit when |
---|
| 47 | there is an "order by". |
---|
| 48 | |
---|
| 49 | See http://listserv.sap.com/pipermail/sapdb.general/2002-January/010405.html |
---|
| 50 | */ |
---|
| 51 | |
---|
| 52 | }; |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | class ADORecordSet_sapdb extends ADORecordSet_odbc { |
---|
| 56 | |
---|
| 57 | var $databaseType = "sapdb"; |
---|
| 58 | |
---|
| 59 | function ADORecordSet_sapdb($id,$mode=false) |
---|
| 60 | { |
---|
| 61 | $this->ADORecordSet_odbc($id,$mode); |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | } //define |
---|
| 66 | ?> |
---|