ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/PApp-SQL/SQL.pm
(Generate patch)

Comparing PApp-SQL/SQL.pm (file contents):
Revision 1.21 by root, Wed Feb 27 04:32:39 2002 UTC vs.
Revision 1.23 by root, Sun Apr 7 16:23:56 2002 UTC

69=over 4 69=over 4
70 70
71=item $sql_exec 71=item $sql_exec
72 72
73Since the C<sql_exec> family of functions return a statement handle there 73Since the C<sql_exec> family of functions return a statement handle there
74must eb another way to test the return value of the C<execute> call. This 74must be another way to test the return value of the C<execute> call. This
75global variable contains the result of the most recent call to C<execute> 75global variable contains the result of the most recent call to C<execute>
76done by this module. 76done by this module.
77 77
78=item $PApp::SQL::DBH 78=item $PApp::SQL::DBH
79 79
111__LINE__ work fine as well). 111__LINE__ work fine as well).
112 112
113The reason C<$id> is necessary is that you might specify special connect 113The reason C<$id> is necessary is that you might specify special connect
114arguments or special flags, or you might want to configure your $DBH 114arguments or special flags, or you might want to configure your $DBH
115differently than maybe other applications requesting the same database 115differently than maybe other applications requesting the same database
116connection. If none of this is becessary for your application you can 116connection. If none of this is necessary for your application you can
117leave $id empty (i.e. ""). 117leave C<$id> empty (i.e. "").
118 118
119If specified, C<$connect> is a callback (e.g. a coderef) that will be 119If specified, C<$connect> is a callback (e.g. a coderef) that will be
120called each time a new connection is being established, with the new 120called each time a new connection is being established, with the new
121C<$dbh> as first argument. 121C<$dbh> as first argument.
122 122
163statement handle. The command and the statement handle will be cached 163statement 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
165called only once for each distinct sql call (please keep in mind that the 165called only once for each distinct sql call (please keep in mind that the
166returned statement will always be the same, so, if you call C<sql_exec> 166returned statement will always be the same, so, if you call C<sql_exec>
167with the same dbh and sql-statement twice (e.g. in a subroutine you 167with the same dbh and sql-statement twice (e.g. in a subroutine you
168called), the statement handle for the first call mustn't be used. 168called), the statement handle for the first call mustn't not be in use
169anymore, as the subsequent call will re-use the handle.
169 170
170The database handle (the first argument) is optional. If it is missing, 171The database handle (the first argument) is optional. If it is missing,
171C<sql_exec> first tries to use the variable C<$DBH> in the current (= 172C<sql_exec> first tries to use the variable C<$DBH> in the current (=
172calling) package and, if that fails, it tries to use database handle in 173calling) package and, if that fails, it tries to use database handle in
173C<$PApp::SQL::DBH>, which you can set before calling these functions. 174C<$PApp::SQL::DBH>, which you can set before calling these functions.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines