… | |
… | |
163 | statement handle. The command and the statement handle will be cached |
163 | statement handle. The command and the statement handle will be cached |
164 | (with the database handle and the sql string as key), so prepare will be |
164 | (with the database handle and the sql string as key), so prepare will be |
165 | called only once for each distinct sql call (please keep in mind that the |
165 | called only once for each distinct sql call (please keep in mind that the |
166 | returned statement will always be the same, so, if you call C<sql_exec> |
166 | returned statement will always be the same, so, if you call C<sql_exec> |
167 | with the same dbh and sql-statement twice (e.g. in a subroutine you |
167 | with the same dbh and sql-statement twice (e.g. in a subroutine you |
168 | called), the statement handle for the first call mustn't be used. |
168 | called), the statement handle for the first call mustn't not be in use |
|
|
169 | anymore, as the subsequent call will re-use the handle. |
169 | |
170 | |
170 | The database handle (the first argument) is optional. If it is missing, |
171 | The database handle (the first argument) is optional. If it is missing, |
171 | C<sql_exec> first tries to use the variable C<$DBH> in the current (= |
172 | C<sql_exec> first tries to use the variable C<$DBH> in the current (= |
172 | calling) package and, if that fails, it tries to use database handle in |
173 | calling) package and, if that fails, it tries to use database handle in |
173 | C<$PApp::SQL::DBH>, which you can set before calling these functions. |
174 | C<$PApp::SQL::DBH>, which you can set before calling these functions. |