📄 ch24_01.htm
字号:
data sources and ODBC remarks about them. They are returned in theform of:</p><blockquote><pre class="code">$ArrayName{'DSN'}=Driver</pre></blockquote></div><a name="INDEX-3483" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>Debug</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->Debug( [ 0 | 1 ] )</pre><p><a name="INDEX-3483" />Sets the debug option to on oroff. If nothing is specified, then nothing is changed. Returns thedebugging value (<tt class="literal">1</tt> or <tt class="literal">0</tt>).</p></div><a name="INDEX-3484" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>Drivers</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->Drivers( )</pre><p><a name="INDEX-3484" />Returns an associative array ofODBC Drivers and their attributes. They are returned in the form of:</p><blockquote><pre class="code">$ArrayName{'<em class="replaceable"><tt>driver</em>'}=<em class="replaceable">Attrib1</em>;<em class="replaceable">Attrib2</em>;<em class="replaceable">Attrib3</em>;...</pre></blockquote><p>in which <em class="replaceable">driver</tt></em> is the ODBC driver name,and <em class="replaceable"><tt>AttribX</tt></em> are the driver-definedattributes.</p></div><a name="INDEX-3485" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>DropCursor</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->DropCursor([<em class="replaceable">close_type</em>])</pre><p><a name="INDEX-3485" />Drops the cursor associated withthe ODBC object. This forces the cursor to be deallocated. Thisoverrides <tt class="literal">SetStmtCloseType</tt>, but the ODBC objectdoes not lose the <tt class="literal">StmtCloseType</tt> setting.<em class="replaceable"><tt>close_type</tt></em> can be any valid<tt class="literal">SmtpCloseType</tt> and will perform a close on thestatement using the specified close type. Returns true on success,false on failure.</p></div><a name="INDEX-3486" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>DumpData</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->DumpData( )</pre><p><a name="INDEX-3486" />Dumps to the screen thefieldnames and all records of the current data set. Used primarilyfor debugging. No return value.</p></div><a name="INDEX-3487" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>Error</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->Error( )</pre><p><a name="INDEX-3487" />Returnsthe last encountered error. The returned value is context-dependent.</p><p>If called in a scalar context, then a three-element array isreturned:</p><blockquote><pre class="code">( <em class="replaceable"><tt>error_number</em>, <em class="replaceable">error_text</em>, <em class="replaceable">connection_number</em> )</pre></blockquote><p>If called in a string context, then a string is returned: </p><blockquote><pre class="code">"[<em class="replaceable">error_number</em>] [<em class="replaceable">connection_number</em>] [<em class="replaceable">error_text</em>]"</pre></blockquote><p>If debugging is on, then two more variables are returned: </p><blockquote><pre class="code">( ..., <em class="replaceable">function</em>, <em class="replaceable">level</em> )</pre></blockquote><p><em class="replaceable">function</tt></em> is the name of the function inwhich the error occurred, and <em class="replaceable"><tt>level</tt></em>represents extra information about the error (usually the location ofthe error).</p></div><a name="INDEX-3488" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>FetchRow</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->FetchRow(<em class="replaceable">row</em>, [<em class="replaceable">type</em>])</pre><p><a name="INDEX-3488" />Retrieves the next record fromthe keyset. When <em class="replaceable"><tt>row</tt></em> and/or<em class="replaceable"><tt>type</tt></em> are specified, the call is made usingSQLExtendedFetch instead of SQLFetch. Returns true when anotherrecord is available to read and false when there are no more records.</p></div><a name="INDEX-3489" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>FieldNames</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->FieldNames( )</pre><p><a name="INDEX-3489" />Returns an array of fieldnamesfound in the current data set. The order isn'tspecified.</p></div><a name="INDEX-3490" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetConnections</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetConnections( )</pre><p><a name="INDEX-3490" />Returns an array of connectionnumbers showing which connections are currently open.</p></div><a name="INDEX-3491" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetConnectOption</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetConnectOption(<em class="replaceable">option</em>)</pre><p><a name="INDEX-3491" />Returns the value of thespecified connect option <em class="replaceable"><tt>option</tt></em>. (Refer toODBC documentation for more information on the options and values.)Returns a string or scalar depending upon the option specified.</p></div><a name="INDEX-3492" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetCursorName</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetCursorName( )</pre><p><a name="INDEX-3492" />Returns the name of the currentcursor as a string or <tt class="literal">undef</tt>.</p></div><a name="INDEX-3493" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetData</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetData( )</pre><p><a name="INDEX-3493" />Retrieves the current row fromthe dataset. This is not generally used by users; it is usedinternally. Returns an array of field data in which the first elementis either false (if successful) or true (if not successful).</p></div><a name="INDEX-3494" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>getDSN</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->getDSN([<em class="replaceable">dsn</em>])</pre><p><a name="INDEX-3494" />Returns an associative arrayindicating the configuration for the specified<em class="replaceable"><tt>dsn</em>. If no <em class="replaceable">dsn</tt></em>is specified, then the current connection is used. The returnedassociative array consists of:</p><blockquote><pre class="code">keys=DSN keyword; values=Keyword value. $Data{$Keyword}=Value</pre></blockquote></div><a name="INDEX-3495" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetFunctions</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetFunctions([<em class="replaceable">function1</em>, <em class="replaceable">function2</em>])</pre><p><a name="INDEX-3495" />Returns an associative arrayindicating the ability of the ODBC Driver to support the specifiedfunctions. If no functions are specified, then a 100-elementassociative array is returned containing all possible functions andtheir values. <em class="replaceable"><tt>function</tt></em> must be in the formof an ODBC API constant such as SQL_API_SQLTRANSACT. The returnedarray will contain the results:</p><blockquote><pre class="code">$Results{SQL_API_SQLTRANSACT}=Value</pre></blockquote><p>For example: </p><blockquote><pre class="code">$Results = $O->GetFunctions( $O->SQL_API_SQLTRANSACT, SQL_API_SQLSETCONNECTOPTION);$ConnectOption = $Results{SQL_API_SQLSETCONNECTOPTION};$Transact = $Results{SQL_API_SQLTRANSACT};</pre></blockquote></div><a name="INDEX-3496" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetInfo</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetInfo([<em class="replaceable">option</em>])</pre><p><a name="INDEX-3496" />Returns a string indicating thevalue of the particular option specified.</p></div><a name="INDEX-3497" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetMaxBufSize</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetMaxBufSize( )</pre><p><a name="INDEX-3497" />Returns the current allocatedlimit for MaxBufSize. For more info, see SetMaxBufSize.</p></div><a name="INDEX-3498" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetSQLState</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetSQLState( )</pre><p><a name="INDEX-3498" />Returns a string indicating theSQL state as reported by ODBC. The SQL state is a code that the ODBCManager or ODBC Driver returns after the execution of a SQL function.This is helpful for debugging purposes.</p></div><a name="INDEX-3499" /><div class="refentry"><table width="515" border="0" cellpadding="5"><tr><td align="left"><font size="+1"><b>GetStmtCloseType</b></font></td><td align="right"><i></i></td></tr></table><hr width="515" size="3" noshade="true" align="left" color="black" /><pre>Win32::ODBC->GetStmtCloseType([<em class="replaceable">connection</em>])</pre><p><a name="INDEX-3499" />Returns a string indicating thetype of closure that will be used every time the hstmt is freed. (See<tt class="literal">SetStmtCloseType</tt> for details.) By default, theconnection of the current object will be used. If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -