I have to simulate an array as if it was returned from Net::DBI fetchall_arrayref function.
Lets say that the SQL query is something like "SELECT data1,data2,data3 from table1 "
I have an XML file as
<type1>
<data1>a</data1>
<data2>b</data2>
<data3>c</data3>
</type1>
<type1>
<data1>da</data1>
<data2>db</data2>
<data3>dc<...
Why doesn't this code execute the signal handler until after $sth->execute completes? And more importantly, how can I fix it?
#!/usr/bin/perl
use strict;
use warnings;
use DBI;
use Sys::SigAction qw( set_sig_handler );
my $dbh = DBI->connect('dbi:Pg:dbname=dc');
eval {
my $h = set_sig_handler('ALRM', sub { die "timeout\n" });
...
Is there a known problem with SQLite giving a "database is locked" error for a second query in a single transaction when using Perl DBD::SQLite? Scenario: Linux, Perl DBI, AutoCommit => 0, a subroutine with two code blocks (using the blocks to localize variable names). In the first code block a query handle is created by prepare() on a s...
This is a tricky one to explain (and very weird), so bear with me. I will explain the problem, and the fix for it, but I would like to see if anyone can explain why it works the way it works :)
I have a web application that uses mod_perl. It uses MySQL database, and I am writing data to a database on regular basis. It is modular, so it ...
I am trying to query Sybase database using DBD::Sybase. Can someone please clarify what is the difference between using syb_nsql vs prepare(...) - execute(..) calls?
...
I need to ensure that this LOAD query succeeded. How do I know inside my program it did not fail?
sub loaddata{
my ($name) = @_;
my $DBH = init_dbh( );
my $STH_GO = $DBH->prepare(q{
LOAD DATA LOCAL INFILE '?' INTO TABLE authors FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r...
I'm using Sybase::CTlib to query a Sybase server. However when I execute the following:
while( $dbr->ct_results($restype) == CS_SUCCEED ) {
if( $restype == CS_CMD_FAIL ) {
warn "Update Check Failed...";
next;
}
next unless $dbr->ct_fetchable($restype);
$ts = $dbr->ct_fetch;
}
My query returns exactly one value....
Hello,
I'm using CentOS 5.5 Linux (same as Redhat 5.5)
with stock perl v5.8.8 and have installed
DBD-Pg-2.17.1 via CPAN shell and I'm using
postgresql-server-8.4.5-1PGDG.rhel5 and friends.
I have prepared a simple test case demonstrating
my problem - it is listed at the bottom.
My code works ok, when I remove {pg_async => PG_ASYNC}
M...