in reply to Re^3: DBD::Pg copy issues
in thread DBD::Pg copy issues
K, I have this now
Tradez
"Never underestimate the predictability of stupidity"
- Bullet Tooth Tony, Snatch (2001)
And i am still not getting inserts at all into the DB. What is the way to see what errStr has on the DBH obj, i tried like it was a STH and it didn't work.$dbh->func('COPY snapshot_$formName (name, value, collect_date, omp +_id) from STDIN', 'putline'); print "Started a line\n"; foreach my $values (@form_out){ #my $cmd = `rm -f $form_out`; my @values = split(/;/, $values); my @names = split(/ /, $ga->{'outputString'}{$formName}); my $count = 0; $count = 0; foreach my $value (@values){ chomp($value); if (!$names[$count]){ print "$value element # $count does not exist in array\n"; } my $name = $names[$count]; chomp($name); $value =~ s/\s+/ / if $value; $value = 'Null' if (length($value) < '1'); if ($value =~ /\w+/){ $dbh->func("$name\t$value\t$date\t$ompId", 'putline'); }else{ $dbh->func("$name\tNull\t$date\t$ompId", 'putline'); } $count++; } } $dbh->func( "\\.\n", 'putline' ); print "ended that line\n";
Tradez
"Never underestimate the predictability of stupidity"
- Bullet Tooth Tony, Snatch (2001)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: DBD::Pg copy issues
by diotalevi (Canon) on Sep 10, 2004 at 21:19 UTC | |
by tradez (Pilgrim) on Sep 14, 2004 at 19:42 UTC | |
by diotalevi (Canon) on Sep 14, 2004 at 22:38 UTC | |
by tradez (Pilgrim) on Sep 15, 2004 at 15:40 UTC |
In Section
Seekers of Perl Wisdom