Changeset 10923 for trunk/gsdl
- Timestamp:
- 2005-11-23T12:15:42+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/DBPlug.pm
r10347 r10923 127 127 # then get pagename from "page" and content from "version" ! 128 128 129 my $sql_query_prime = undef ; 129 130 my $sql_query = undef ; 130 131 … … 142 143 while (defined($line=<CONF>)) { 143 144 chomp $line; 145 $line .= " "; # for multi-line statements - don't conjoin! 144 146 $line =~ s/\s*\#.*$//mg; # remove comments 145 147 $statement .= $line; … … 210 212 } 211 213 212 my $statement_hand=$dbhandle->prepare($sql_query); 214 my $statement_hand; 215 216 # The user gave 2 sql statements to execute? 217 if ($sql_query_prime) { 218 $statement_hand=$dbhandle->prepare($sql_query_prime); 219 $statement_hand->execute; 220 if ($statement_hand->err) { 221 print $outhandle "Error: " . $statement_hand->errstr . "\n"; 222 return undef; 223 } 224 } 225 226 $statement_hand=$dbhandle->prepare($sql_query); 213 227 $statement_hand->execute; 228 if ($statement_hand->err) { 229 print $outhandle "Error: " . $statement_hand->errstr . "\n"; 230 return undef; 231 } 214 232 215 233 # get the array-ref for the field names and cast it to array … … 228 246 } 229 247 230 # print "DBPlug: names: " . join (", ", @field_names) . ".\n";231 248 # get rows 232 249 … … 278 295 foreach my $fieldname (@field_names) { 279 296 my $fielddata=shift @row_array; 297 298 if (! defined($fielddata) ) { 299 next; # this field was "" or NULL 300 } 280 301 # use the specified encoding, defaulting to utf-8 281 302 if (defined($encoding) && $encoding ne "ascii"
Note:
See TracChangeset
for help on using the changeset viewer.