BruceDB has asked for the wisdom of the Perl Monks concerning the following question:
... my $data_file = "data.tsv"; my $s2 = "\copy (" . $tableName . ") FROM '" . $data_file . "'"; $dbh->do($s2); ...
However, when I run the script I get the following error:
DBD::Pg::db do failed: ERROR: syntax error at or near "" LINE 1: py (testingtable) FROM 'data.tsv' ^ at ./dbcopy.pl line 48.
What is the correct syntax?
Thx!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Correct syntax for using \copy to import a file into a Postgres db
by bichonfrise74 (Vicar) on Nov 12, 2009 at 05:02 UTC | |
by BruceDB (Novice) on Nov 12, 2009 at 06:20 UTC | |
by Anonymous Monk on Sep 03, 2014 at 16:40 UTC |