⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbd::interbase.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 3 页
字号:
.SpSupported by the driver as proposed by \s-1DBI\s0.This should be used for non-select statements, where the driver doesn't takethe conservative prepare \- execute steps, thereby speeding up the executiontime. But if this method is used with bind values, the speed advantagediminishes as this method calls \fIprepare()\fR for binding the placeholders.Instead of calling this method repeatedly with bind values, it would bebetter to call \fIprepare()\fR once, and \fIexecute()\fR many times..SpSee the notes for the execute method elsewhere in this document. Unlike theexecute method, currently this method doesn't return the number of affectedrows..IP "\fBcommit\fR" 4.IX Item "commit".Vb 1\&  $rc  = $dbh\->commit;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0. See also the notes about \fBTransactions\fR elsewhere in this document..IP "\fBrollback\fR" 4.IX Item "rollback".Vb 1\&  $rc  = $dbh\->rollback;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0. See also the notes about \fBTransactions\fR elsewhere in this document..IP "\fBdisconnect\fR" 4.IX Item "disconnect".Vb 1\&  $rc  = $dbh\->disconnect;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBping\fR" 4.IX Item "ping".Vb 1\&  $rc = $dbh\->ping;.Ve.SpThis driver supports the ping-method, which can be used to check the validity of a database-handle. This is especially required by\&\f(CW\*(C`Apache::DBI\*(C'\fR..IP "\fBtable_info\fR" 4.IX Item "table_info".Vb 1\&  $sth = $dbh\->table_info;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBtables\fR" 4.IX Item "tables".Vb 1\&  @names = $dbh\->tables;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBtype_info_all\fR" 4.IX Item "type_info_all".Vb 1\&  $type_info_all = $dbh\->type_info_all;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..SpFor further details concerning the InterBase specific data-types please read the \*(L"InterBase Data Definition Guide\*(R"..IP "\fBtype_info\fR" 4.IX Item "type_info".Vb 1\&  @type_info = $dbh\->type_info($data_type);.Ve.SpImplemented by \s-1DBI\s0, no driver-specific impact..IP "\fBquote\fR" 4.IX Item "quote".Vb 1\&  $sql = $dbh\->quote($value, $data_type);.Ve.SpImplemented by \s-1DBI\s0, no driver-specific impact..Sh "Database Handle Attributes".IX Subsection "Database Handle Attributes".IP "\fBAutoCommit\fR  (boolean)" 4.IX Item "AutoCommit  (boolean)"Supported by the driver as proposed by \s-1DBI\s0. According to the classification of \s-1DBI\s0, InterBase is a database, in which a transaction must be explicitly started. Without starting a transaction, every change to the database becomes immediately permanent. The default of AutoCommit is on, which corresponds to the \s-1DBI\s0's default. When setting AutoCommit to off, a transaction will be started and every commit or rollback will automatically start a new transaction. For details see the notes about \fBTransactions\fR elsewhere in this document..IP "\fBDriver\fR  (handle)" 4.IX Item "Driver  (handle)"Implemented by \s-1DBI\s0, no driver-specific impact..IP "\fBName\fR  (string, read-only)" 4.IX Item "Name  (string, read-only)"Not yet implemented..IP "\fBRowCacheSize\fR  (integer)" 4.IX Item "RowCacheSize  (integer)"Implemented by \s-1DBI\s0, not used by the driver..IP "\fBib_softcommit\fR  (driver-specific, boolean)" 4.IX Item "ib_softcommit  (driver-specific, boolean)"Set this attribute to \s-1TRUE\s0 to use InterBase's soft commit feature (defaultto \s-1FALSE\s0). Soft commit retains the internal transaction handle whencommitting a transaction, while the default commit behavior always closesand invalidates the transaction handle..SpSince the transaction handle is still open, there is no need to start a new transaction upon every commit, so applications can gain performance improvement. Using soft commit is also desirable when dealing with nested statement handles under AutoCommit on..SpSwitching the attribute's value from \s-1TRUE\s0 to \s-1FALSE\s0 will force hard commit thus closing the current transaction..SH "STATEMENT HANDLE OBJECTS".IX Header "STATEMENT HANDLE OBJECTS".Sh "Statement Handle Methods".IX Subsection "Statement Handle Methods".IP "\fBbind_param\fR" 4.IX Item "bind_param"Supported by the driver as proposed by \s-1DBI\s0. The \s-1SQL\s0 data type passed as the third argument is ignored..IP "\fBbind_param_inout\fR" 4.IX Item "bind_param_inout"Not supported by this driver..IP "\fBexecute\fR" 4.IX Item "execute".Vb 1\&  $rv = $sth\->execute(@bind_values);.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBfetchrow_arrayref\fR" 4.IX Item "fetchrow_arrayref".Vb 1\&  $ary_ref = $sth\->fetchrow_arrayref;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBfetchrow_array\fR" 4.IX Item "fetchrow_array".Vb 1\&  @ary = $sth\->fetchrow_array;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBfetchrow_hashref\fR" 4.IX Item "fetchrow_hashref".Vb 1\&  $hash_ref = $sth\->fetchrow_hashref;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBfetchall_arrayref\fR" 4.IX Item "fetchall_arrayref".Vb 1\&  $tbl_ary_ref = $sth\->fetchall_arrayref;.Ve.SpImplemented by \s-1DBI\s0, no driver-specific impact..IP "\fBfinish\fR" 4.IX Item "finish".Vb 1\&  $rc = $sth\->finish;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBrows\fR" 4.IX Item "rows".Vb 1\&  $rv = $sth\->rows;.Ve.SpSupported by the driver as proposed by \s-1DBI\s0. It returns the number of \fBfetched\fR rows for select statements, otherwiseit returns \-1 (unknown number of affected rows)..IP "\fBbind_col\fR" 4.IX Item "bind_col".Vb 1\&  $rc = $sth\->bind_col($column_number, \e$var_to_bind, \e%attr);.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBbind_columns\fR" 4.IX Item "bind_columns".Vb 1\&  $rc = $sth\->bind_columns(\e%attr, @list_of_refs_to_vars_to_bind);.Ve.SpSupported by the driver as proposed by \s-1DBI\s0..IP "\fBdump_results\fR" 4.IX Item "dump_results".Vb 1\&  $rows = $sth\->dump_results($maxlen, $lsep, $fsep, $fh);.Ve.SpImplemented by \s-1DBI\s0, no driver-specific impact..Sh "Statement Handle Attributes".IX Subsection "Statement Handle Attributes".IP "\fB\s-1NUM_OF_FIELDS\s0\fR  (integer, read-only)" 4.IX Item "NUM_OF_FIELDS  (integer, read-only)"Implemented by \s-1DBI\s0, no driver-specific impact..IP "\fB\s-1NUM_OF_PARAMS\s0\fR  (integer, read-only)" 4.IX Item "NUM_OF_PARAMS  (integer, read-only)"Implemented by \s-1DBI\s0, no driver-specific impact..IP "\fB\s-1NAME\s0\fR  (array-ref, read-only)" 4.IX Item "NAME  (array-ref, read-only)"Supported by the driver as proposed by \s-1DBI\s0..IP "\fBNAME_lc\fR  (array-ref, read-only)" 4.IX Item "NAME_lc  (array-ref, read-only)"Implemented by \s-1DBI\s0, no driver-specific impact..IP "\fBNAME_uc\fR  (array-ref, read-only)" 4.IX Item "NAME_uc  (array-ref, read-only)"Implemented by \s-1DBI\s0, no driver-specific impact..IP "\fB\s-1TYPE\s0\fR  (array-ref, read-only)" 4.IX Item "TYPE  (array-ref, read-only)"Supported by the driver as proposed by \s-1DBI\s0, with the restriction, that the types are InterBasespecific data-types which do not correspond to international standards..IP "\fB\s-1PRECISION\s0\fR  (array-ref, read-only)" 4.IX Item "PRECISION  (array-ref, read-only)"Supported by the driver as proposed by \s-1DBI\s0..IP "\fB\s-1SCALE\s0\fR  (array-ref, read-only)" 4.IX Item "SCALE  (array-ref, read-only)"Supported by the driver as proposed by \s-1DBI\s0..IP "\fB\s-1NULLABLE\s0\fR  (array-ref, read-only)" 4.IX Item "NULLABLE  (array-ref, read-only)"Supported by the driver as proposed by \s-1DBI\s0..IP "\fBCursorName\fR  (string, read-only)" 4.IX Item "CursorName  (string, read-only)"Supported by the driver as proposed by \s-1DBI\s0..IP "\fBStatement\fR  (string, read-only)" 4.IX Item "Statement  (string, read-only)"Supported by the driver as proposed by \s-1DBI\s0..IP "\fBRowCache\fR  (integer, read-only)" 4.IX Item "RowCache  (integer, read-only)"Not supported by the driver..SH "TRANSACTION SUPPORT".IX Header "TRANSACTION SUPPORT"The transaction behavior is controlled with the attribute AutoCommit. For a complete definition of AutoCommit please refer to the \s-1DBI\s0 documentation..PPAccording to the \s-1DBI\s0 specification the default for AutoCommit is \s-1TRUE\s0. In this mode, any change to the database becomes valid immediately. Any \&\fIcommit()\fR or \fIrollback()\fR will be rejected..PPIf AutoCommit is switched-off, immediately a transaction will be started.A \fIrollback()\fR will rollback and close the active transaction, then implicitly start a new transaction. A disconnect will issue a rollback..PPInterBase provides fine control over transaction behavior, where users canspecify the access mode, the isolation level, the lock resolution, and the table reservation (for a specified table). For this purpose,\&\f(CW\*(C`ib_set_tx_param()\*(C'\fR database handle method is available..PPUpon a successful \f(CW\*(C`connect()\*(C'\fR, these default parameter values will be usedfor every \s-1SQL\s0 operation:.PP.Vb 3\&    Access mode:        read_write\&    Isolation level:    snapshot\&    Lock resolution:    wait.Ve.PPAny of the above value can be changed using \f(CW\*(C`ib_set_tx_param()\*(C'\fR..IP "\fBib_set_tx_param\fR" 4.IX Item "ib_set_tx_param".Vb 6\& $dbh\->func( \&    \-access_mode     => \*(Aqread_write\*(Aq,\&    \-isolation_level => \*(Aqread_committed\*(Aq,\&    \-lock_resolution => \*(Aqwait\*(Aq,\&    \*(Aqib_set_tx_param\*(Aq\& );.Ve.SpValid value for \f(CW\*(C`\-access_mode\*(C'\fR is \f(CW\*(C`read_write\*(C'\fR, or \f(CW\*(C`read_only\*(C'\fR..SpValid value for \f(CW\*(C`\-lock_resolution\*(C'\fR is \f(CW\*(C`wait\*(C'\fR, or \f(CW\*(C`no_wait\*(C'\fR. In Firebird 2.0, a timeout value for wait is introduced. This can be specified using hash ref as lock_resolution value:.Sp.Vb 4\& $dbh\->func(\&    \-lock_resolution => { wait => 5 }, # wait for 5 seconds\&    \*(Aqib_set_tx_param\*(Aq\& );.Ve.Sp\&\f(CW\*(C`\-isolation_level\*(C'\fR may be: \f(CW\*(C`read_committed\*(C'\fR, \f(CW\*(C`snapshot\*(C'\fR,\&\f(CW\*(C`snapshot_table_stability\*(C'\fR..SpIf \f(CW\*(C`read_committed\*(C'\fR is to be used with \f(CW\*(C`record_version\*(C'\fR or\&\f(CW\*(C`no_record_version\*(C'\fR, then they should be inside an anonymous array:.Sp.Vb 4\& $dbh\->func( \&    \-isolation_level => [\*(Aqread_committed\*(Aq, \*(Aqrecord_version\*(Aq],\&    \*(Aqib_set_tx_param\*(Aq\& );.Ve.SpTable reservation is supported since \f(CW\*(C`DBD::InterBase 0.30\*(C'\fR. Names of thetables to reserve as well as their reservation params/values are specifiedinside a hashref, which is then passed as the value of \f(CW\*(C`\-reserving\*(C'\fR..SpThe following example reserves \f(CW\*(C`foo_table\*(C'\fR with \f(CW\*(C`read\*(C'\fR lock and \f(CW\*(C`bar_table\*(C'\fR with \f(CW\*(C`read\*(C'\fR lock and \f(CW\*(C`protected\*(C'\fR access:.Sp.Vb 10\& $dbh\->func(\&    \-access_mode     => \*(Aqread_write\*(Aq,\&    \-isolation_level => \*(Aqread_committed\*(Aq,\&    \-lock_resolution => \*(Aqwait\*(Aq,\&    \-reserving       =>\&        {\&            foo_table => {\&                lock    => \*(Aqread\*(Aq,\&            },\&            bar_table => {\&                lock    => \*(Aqread\*(Aq,\&                access  => \*(Aqprotected\*(Aq,\&            },\&        },\&    \*(Aqib_set_tx_param\*(Aq\& );.Ve.SpPossible table reservation parameters are:.RS 4.ie n .IP """access"" (optional)" 4.el .IP "\f(CWaccess\fR (optional)" 4.IX Item "access (optional)"Valid values are \f(CW\*(C`shared\*(C'\fR or \f(CW\*(C`protected\*(C'\fR..ie n .IP """lock"" (required)" 4.el .IP "\f(CWlock\fR (required)" 4.IX Item "lock (required)"Valid values are \f(CW\*(C`read\*(C'\fR or \f(CW\*(C`write\*(C'\fR..RE.RS 4.SpUnder \f(CW\*(C`AutoCommit\*(C'\fR mode, invoking this method doesn't only change thetransaction parameters (as with \f(CW\*(C`AutoCommit\*(C'\fR off), but also commits thecurrent transaction. The new transaction parameters will be used inany newly started transaction..Sp\&\f(CW\*(C`ib_set_tx_param()\*(C'\fR can also be invoked with no parameter in which it resetstransaction parameters to the default value..RE.SH "DATE, TIME, and TIMESTAMP FORMATTING SUPPORT".IX Header "DATE, TIME, and TIMESTAMP FORMATTING SUPPORT"\&\f(CW\*(C`DBD::InterBase\*(C'\fR supports various formats for query results of \s-1DATE\s0, \s-1TIME\s0,and \s-1TIMESTAMP\s0 types..PPBy default, it uses \*(L"%c\*(R" for \s-1TIMESTAMP\s0, \*(L"%x\*(R" for \s-1DATE\s0, and \*(L"%X\*(R" for \s-1TIME\s0,and pass them to \s-1ANSI\s0 C's \fIstrftime()\fR function to format your query results.These values are respectively stored in ib_timestampformat, ib_dateformat,and ib_timeformat attributes, and may be changed in two ways:.IP "\(bu" 4At \f(CW$dbh\fR level.SpThis replaces the default values. Example:.Sp.Vb 3\& $dbh\->{ib_timestampformat} = \*(Aq%m\-%d\-%Y %H:%M\*(Aq;\& $dbh\->{ib_dateformat} = \*(Aq%m\-%d\-%Y\*(Aq;\& $dbh\->{ib_timeformat} = \*(Aq%H:%M\*(Aq;.Ve.IP "\(bu" 4At \f(CW$sth\fR level.SpThis overrides the default values only for the currently prepared statement. Example:.Sp.Vb 7\& $attr = {\&    ib_timestampformat => \*(Aq%m\-%d\-%Y %H:%M\*(Aq,\&    ib_dateformat => \*(Aq%m\-%d\-%Y\*(Aq,\&    ib_timeformat => \*(Aq%H:%M\*(Aq,\& };\& # then, pass it to prepare() method. \& $sth = $dbh\->prepare($sql, $attr);.Ve.PPSince locale settings affect the result of \fIstrftime()\fR, if your applicationis designed to be portable across different locales, you may consider using thesetwo special formats: '\s-1TM\s0' and '\s-1ISO\s0'. \f(CW\*(C`TM\*(C'\fR returns a 9\-element list, much likePerl's \fIlocaltime()\fR. The \f(CW\*(C`ISO\*(C'\fR format applies \fIsprintf()\fR's pattern\&\*(L"%04d\-%02d\-%02d \f(CW%02d:\fR%02d:%02d.%04d\*(R" for \s-1TIMESTAMP\s0, \*(L"%04d\-%02d\-%02d\*(R" for\&\s-1DATE\s0, and \*(L"%02d:%02d:%02d.%04d\*(R" for \s-1TIME\s0..PP\&\f(CW\*(C`$dbh\->{ib_time_all}\*(C'\fR can be used to specify all of the three formats atonce. Example:.PP.Vb 1\& $dbh\->{ib_time_all} = \*(AqTM\*(Aq;.Ve.SH "EVENT ALERT SUPPORT".IX Header "EVENT ALERT SUPPORT"Event alerter is used to notify client applications whenever something ishappened on the database. For this to work, a trigger should be created,which then calls \s-1POST_EVENT\s0 to post the event notification to the interestedclient. A client could behave in two ways: wait for the event synchronously,or register a callback which will be invoked asynchronously each time aposted event received..ie n .IP """ib_init_event""" 4.el .IP "\f(CWib_init_event\fR" 4.IX Item "ib_init_event"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -