您的位置:首页 >> Web开发 >> CGI技术 >> 正文
CGI技术 RSS
 

关于odbc的一个文挡说明,奉献给大家

http://www.rdxx.com 06年04月21日 07:27 网海之贝 我要投稿

关键词: 说明 , ODBC

断开连接


Data
Data list
Retrieve data from previous fetch for a list of field names.
In a scalar context it returns all of the field values concatenated together.
In an array context, it returns an array of the values, in the order in which they were
specified.
If no field names are given, all fields are returned in an unspecified order.
Example:
$db->Sql("SELECT f1, f2, f3 FROM foo");
$db->FetchRow();
($f1, $f2) = $db->Data("f1", "f2");

or

$db->Sql("SELECT * FROM foo");
$db->FetchRow();
@values = $db->Data;
See also: DataHash


DataHash
DataHash list
Retrieve data from previous fetch for a list of field names. Returns a hash where the field name is the key. If no field names are given, all fields are returned.
Example:
$db->Sql("SELECT f1, f2, f3 FROM foo");
$db->FetchRow();
%hash = $db->DataHash("f1", "f2");
print $hash{f1};

or

$db->Sql("SELECT * FROM foo");
$db->FetchRow();
%hash = $db->DataHash;
foreach $key (sort(keys %hash)) {
    print $key, '=', $hash{$key}, "\n";
}
See also: Data



DataSources
Returns an associative array of Data Sources and ODBC remarks in the form of:
$ArrayName{'DSN'} = Remark
where DSN is the Data Source Name and Remark is, well, the remark.
Example:
%rem = $db->DataSources;
print LOG qq(Current DSN's Remark: "), %rem{$db->GetDSN}, qq("\n);

Back to the top  

Drivers
Returns an associative array of Drivers and their attributes in the form of:
$ArrayName{'DRIVER'} = Attrib1;Attrib2;Attrib3;...
where DRIVER is the ODBC Driver Name and AttribX are the driver-defined attributes.
Example:
%attrib = $db->Drivers;
print LOG qq($driver: $attrib{$driver}\n) foreach $driver (keys %attrib);

Back to the top  

DumpError
Dump to the screen details about the last error condition. This includes error number, error text and the ODBC connection number that caused the error (if there is one). This is used primarily for debugging.
Example:
$db = new Win32::ODBC("My DSN");
if (undef $db){
    Win32::ODBC::DumpError();
共6页  第1页 第2页 第3页 第4页 第5页 第6页

 
 
标签: 说明 , ODBC 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站