On 11/13/06, RB Smissaert <[EMAIL PROTECTED]> wrote:
Trying to move data from Interbase to SQLite via the ODBC driver and ADO and
having trouble to get the right syntax for the INSERT INTO statement.

This is what I have now, but it fails with the error: only one SQL statement
allowed.

I notice your code creates this sql:

INSERT INTO  READCODE (SUBJECT_TYPE, READ_CODE, TERM30, TERM60)
SELECT R.SUBJECT_TYPE, R.READ_CODE, R.TERM30, R.TERM60
FROM READCODE R
IN " [  ? ] "

Which isn't valid.  The IN clause is part of WHERE, not a separate qualifier.
It works like this:

select x as prime  from mytable  where x in ( 1,2,3,5,7 );

Since the select is reading from READCODE you're inserting values
into the same table you're selecting them from. There's no way that I know
of to use odbc to copy from one database to another unless they're both
of the same type.

I would do it by selecting all the values to copy in one statement and writing
them to memory or a disk file. Then import to the other database in a second
step.




--
SqliteImporter and SqliteReplicator: Command line utilities for Sqlite
http://www.reddawn.net/~jsprenkl/Sqlite

Cthulhu Bucks!
http://www.cthulhubucks.com

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to