in reply to SQLite function .import not working

First of all, just to be sure, the example you provided had an opening double-quote, but not a closing one. I am assuming that this is a typo. Did you RTFC :)? (I understand that having only one eye can make this kind of hard). I looked at dbdimp.c line 271. It looks to me like the DBD api for SQLite may not use the dot notation for commands. Did you try it without the leading dot? Also, from the code, it looks like it is possible to turn on message tracing. This might help you out as well. Illuminatus
  • Comment on Re: SQLite function .import not working

Replies are listed 'Best First'.
Re^2: SQLite function .import not working
by polyphemus (Novice) on Oct 16, 2007 at 20:36 UTC
    You monks are indeed wise. Thank you very much. I have it now.
    .import is not something the database understands. Therefore, I just tried

    system "sqlite3 databasename \".import filename tablename\"";

    and it worked! I think the same would work for all the other sqlite3 functions that begins with a dot (".").
      By the way, you can avoid escaping double-quotes by using the qq operator, as follows:
      system qq{sqlite3 databasename ".import filename tablename"};
      But... I need to do
      sqlite3 dbname .separator \t .import filename tablename
      How can I do that? (put 2 sqlite3 commands on the command line)?
        Maybe
        system 'sqlite3', 'dbname', ".separator \t\n.import filename tablename +";
        But really, you need to perldoc -f system and man sqlite3
Re^2: SQLite function .import not working
by polyphemus (Novice) on Oct 16, 2007 at 20:26 UTC
    Yes, you are correct, it was just a typo in my post. I did have a closing quote in my code.