We don't bite newbies here... much | |
PerlMonks |
Re: perl DBI & SQLiteby Anonymous Monk |
on Oct 15, 2007 at 23:22 UTC ( [id://645064]=note: print w/replies, xml ) | Need Help?? |
Hello monks, I'm a newbie to Perl and I've been trying to write a script that will import a data file (XXX.out) into a table (XXX) in a SQLite databse, and I would be very appreciative if someone could enlighten me please! Everything was going great until I used $db->do(".import XXX.out XXX); which gave me this error: DBD::SQLite::db do failed: near ".": syntax error(1) at dbdimp.c line 271 at ./new.pl line 13. I tried using single quotes too, and backslashing the period, but nothing worked. The $db->do("create table XXX (@colnames)"); line earlier in the code worked just fine. It also worked when rather than using the .import function I instead used the INSERT function to just insert a few lines. But somehow the .import function won't seem to work. (In fact the .separator function also gave me the same problem, but I changed the data file so that I wouldn't have to use .separator). In fact, when I just go to sqlite myself and try .import XXX.out XXX it imports the XXX.out file into the XXX table just fine! So the problem can't be with the XXX.out data file or the XXX table. But somehow I just can't get it to work in my Perl script. Can someone please shed some light on this? Thank you!
In Section
Seekers of Perl Wisdom
|
|