oracle/sqlrelay/php 把 field 的 name 轉成小寫 sample code

// $__oradb->setOption('portability', DB_PORTABILITY_LOWERCASE);
require_once "config.php";
require_once "sqlrelay.php";

unset($__config['sqlrelay_dsn']);
$__config['sqlrelay_dsn'][]="sqlrelay://xx_id:xx_pass@172.30.0.17:9000";

$sql="select aaa,bbb from xxxx t where g_close_date is null";

$__now=get_microtime();
$__oradb=_fn_connect_sqlrelay();
$__oradb->setOption('portability', DB_PORTABILITY_LOWERCASE);

$result = $__oradb->query($sql);
if (DB::isError($result)) {
  echo "db error\n";
  printf("Execution time : %s\n",get_microtime()-$__now);
  exit;
}

while ( $row=$result->fetchRow(DB_FETCHMODE_ASSOC) ) {
  // -----
  echo $row['aaa'] . ' : ' . $row['bbb'];
}

$result->free();
$__oradb->disconnect();

// 取時間 function
function get_microtime() {
    list($usec, $sec) = explode(' ',microtime() );
    return ((double)$usec + (double)$sec);
}

Comments are closed.

Related URL:
  1. Protected: special oracle SQL command , prevent join
  2. [case] compare Oracle : select …. in (…) / or … explain result
  3. Protected: strange problem, RAC , ORACLE data block corrupted (file # %s, block # %s)
  4. oracle export / import command
  5. Protected: oracle 的一些 SOP command
  6. Maximum Availability Architecture – Oracle Streams Configuration Best Practices
  7. [設定/memo] PL/SQL Developer , plsql 免設 tnsname 檔的方法
  8. Protected: [memo] Streams process
  9. Protected: oracle standby SOP
  10. 使用 mysql partition table sample