I don't know your Wrapper, but try this:
CppSQLite3DB db;
db.open("Stocks.db");
db.execDML("ATTACH 'Options.db' AS OPT;");
sSQL = "UPDATE Stocks SET bOption=1 WHERE rowid IN ";
sSQL += "(SELECT Stocks.rowid FROM Stocks, OPT.Options ";
sSQL += "WHERE Stocks.sStockSymbol = OPT.Options.sStockSymbol); ";
db.execDML(sSQL.c_str());
Note that I prepended the database name assigned in the Attach statement in
your Update/Select statement.
Mike
>I know how to use ATTACH with sqlite3.exe but I am having problems using
>it in C++. I am using a wrapper and what I am trying to do is
>illustrated by:
>
>CppSQLite3DB db;
>
>db.open("Stocks.db");
>
>db.execDML("ATTACH 'Options.db' AS OPT;");
>
> sSQL = "UPDATE Stocks SET bOption=1 WHERE rowid IN ";
> sSQL += "(SELECT Stocks.rowid FROM Stocks, Options ";
> sSQL += "WHERE Stocks.sStockSymbol = Options.sStockSymbol); ";
>
>
> db.execDML(sSQL.c_str());
>
>but this gives me an error saying table Options (in database file
>Options.db) is not available.
>
>How do I get ATTACH to work in C++?
>
>Thanks,
> Roger
>
>-----------------------------------------------------------------------------
>To unsubscribe, send email to [EMAIL PROTECTED]
>-----------------------------------------------------------------------------
>
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------