oracle资料库函式库

时间:2010-01-16 10:37:51   来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:y after the first connection   Example:   var $ConnectQuery="ALTER SESSION SET nls_date_language=german nls_date_format='DD.MM.RRRR'";   -> Set the date format for this session, this is fine when your ora-role   cannot be altered */   var $ConnectQuery=''; &nbs...
  正文:

<?
  class DB_Sql {
  var $Debug = false;
  var $Home = "/u01/app/oracle/product/8.0.4";
  var $Remote = 1;
  /* This Query will be sent directly after the first connection
  Example:
  var $ConnectQuery="ALTER SESSION SET nls_date_language=german nls_date_format='DD.MM.RRRR'";
  -> Set the date format for this session, this is fine when your ora-role
  cannot be altered */
  var $ConnectQuery='';
  /* Due to a strange error with Oracle 8.0.5, apache and PHP3.0.6
  you don't need to set the ENV - on my system Apache
  will change to a zombie, if I don't set this to FALSE!
  Instead I set these ENV-vars before the startup of apache.
  If unsure try it out, if it works. */
  var $OraPutEnv = true;
  
  var $Database = "";
  var $User = "";
  var $Password = "";
  
  var $Link_ID = 0;
  var $Query_ID = 0;
  var $Record = array();
  var $Row;
  
  var $Errno = 0;
  var $Error = "";
  var $ora_no_next_fetch=false;
  
  
  /* copied from db_mysql for completeness */
  /* public: identification constant. never change this. */
  var $type = "oracle";
  var $revision = "Revision: 1.3";
  var $Halt_On_Error = "yes"; ## "yes" (halt with message), "no" (ignore errors quietly), "report" (ignore errror, but spit a warning)
  
  /* public: constructor */
  function DB_Sql($query = "") {
  $this->query($query);
  }
  
  /* public: some trivial reporting */
  function link_id() {
  return $this->Link_ID;
  }
  
  function query_id() {
  return $this->Query_ID;
  }
  
  function connect() {
  ## see above why we do this
  if ($this->OraPutEnv) {
  PutEnv("ORACLE_SID=$this->Database");
  PutEnv("ORACLE_HOME=$this->Home");
  }
  if ( 0 == $this->Link_ID ) {
  if($this->Debug) {
  printf("<br>Connect()ing to $this->Database...<br>n");
  }
  if($this->Remote) {
  if($this->Debug) {
  printf("<br>connect() $this->User/******@$this->Database<br>n");
  }
  $this->Link_ID=ora_plogon
  ("$this->User/$this->Password@$this->Database","");
  /************** (comment by SSilk)
  this dosn't work on my system:
  $this->Link_ID=ora_plogon
  ("$this->User@$this->Database.world","$this->Password");
  ***************/
  } else {
  if($this->Debug) {
  printf("<br>connect() $this->User, $this->Password <br>n");
  }
  $this->Link_ID=ora_plogon("$this->User","$this->Password");
  /* (comment by SSilk: don't know how this could work, but I leave this untouched!) */
  }
来源:http://www.002pc.com/master/College/Programming/PHP/11946.html

 1/7    1 2 3 4 5 6 下一页 尾页
收藏到:

关于《oracle资料库函式库》文章的评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面

随机文章

    SQL Error: select * from ***_ecms_article where classid='86' and checked=1 order by rand() limit 10

顶出来的热门

    SQL Error: select * from ***_ecms_article where classid='86' and checked=1 order by diggtop desc,id desc limit 10
站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td