Dana Lucent wrote:
> Currently,
> I am receiving the error "Execution ERROR: Cannot open .\table: No such
> file or directory at C:/PERL/site/lib/DBD/File.pm line 469.
Do you have a file called "table" in your current working directory? If
not, then you need to either use the name of the file (if the filename
is a valid SQL table name), or else use {csv_tables} to name it.
> my $dbh1=DBI->connect("DBI:CSV:IDEA.CSV");
This is not the correct way to connect to a CSV database, please read
the DBD::CSV documentation. What you want is more like:
my $dbh1=DBI->connect("DBI:CSV:");
$dbh1->{csv_tables}->{table}->{file} = 'IDEA.CSV';
After that you can use the word "table" to refer to the file "IDEA.CSV".
> my $sth1 = $dbh1->prepare( q{
>
> INSERT INTO table (EMIDCM, RLCMCM, RLCDCM, RLCYCM, LIENCM, UOFACM,
> CTIDCM, CTCKCM) VALUES (?, ?, ?, ?, ?, ?, ? ,? ,?)
>
> });
>
>
>
> while ($sth1) {
This is not the correct way to use a statement handle, please read the
DBI documentation for statement handle methods like execute and fetch.
>
> chop;
>
> my ($EMIDCM, $RLCMCM, $RLCDCM, $RLCYCM, $LIENCM, $UOFACM, $CTIDCM,
> $CTCKCM) = split /,/;
I'm totally confused here, you seem to be trying your own CSV parsing on
something that the DBD has already parsed. Perhaps if you explained
what you are trying to do, we could offer suggestions.
--
Jeff