快速业务通道

oracle资料库函式库

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-05-25
G echo"<b>[$col]</b>: $value <br>n";
}
$stat=1;
}

return $stat;
}

## seek() works only for $pos - 1 and $pos
## Perhaps I make a own implementation, but my
## opinion is, that this should be done by PHP3
function seek($pos) {
if ($this->Row - 1 == $pos) {
$this->ora_no_next_fetch=true;
} elseif ($this->Row == $pos ) {
## do nothing
} else {
$this->halt("Invalid seek(): Position is cannot be handled by API.<BR>".
"Only a seek to the last element is allowed in this version<BR>".
"Difference too big. Wanted: $pos Current pos: $this->Row");
}
if ($this->Debug) echo "<BR>Debug: seek = $pos<BR>";
$this->Row=$pos;
}

function lock($table, $mode = "write") {
if ($mode == "write") {
$result = ora_do($this->Link_ID, "lock table $table in row exclusive mode");
} else {
$result = 1;
}
return $result;
}

function unlock() {
return ora_do($this->Link_ID, "commit");
}

// Important note: This function dosn''t work with Oracle-Database-Links!
// You are free to get a better method. :)
function metadata($table,$full=false) {
$count = 0;
$id = 0;
$res = array();

/*
* Due to compatibility problems with Table we changed the behavior
* of metadata();
* depending on $full, metadata returns the following values:
*
* - full is false (default):
* $result[]:
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags ("NOT NULL", "INDEX")
* [0]["format"] precision and scale of number (eg. "10,2") or empty
* [0]["index"] name of index (if has one)
* [0]["chars"] number of chars (if any char-type)
*
* - full is true
* $result[]:
* ["num_fields"] number of metadata records
* [0]["table"] table name
* [0]["name"] field name
* [0]["type"] field type
* [0]["len"] field length
* [0]["flags"] field flags ("NOT NULL", "INDEX")
* [0]["format"] precision and scale of number (eg. "10,2") or empty
* [0]["index"] name of index (if has one)
* [0]["chars"] number of chars (if any char-type)
* [0]["php_type"] the correspondig PHP-type
* [0]["php_subtype"] the subtype of PHP-type
* ["meta"][field name] index of field named "field name"
* This could used, if you have the name, but no index-num - very fast
* Test: if (isset($result[''meta''][''myfield''])) {} ...
*/

$this->connect();

## This is a RIGHT OUTER JOIN: "(+)", if you want to see, what
## this query results try the following:
## $table = new Table; $db = new my_DB_Sql; # you have to make
## # your own class
## $table->show_results($db->query(se

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号