Sorry Igor :) it was my fault! 

I forgot to specify the full path name of the database. So the execute 
statement should be:
 sqlSt= sqlite3_exec(pDb,"ATTACH DATABASE '/opt/db/CommonDB' AS CDB ;" , NULL, 
0, &errMsg);
It worked. Thanks a ton to Igor and Dennis.
JL.






----- Original Message ----
From: Joanne Pham <[EMAIL PROTECTED]>
To: General Discussion of SQLite Database <sqlite-users@sqlite.org>
Sent: Thursday, April 10, 2008 9:33:28 AM
Subject: Re: [sqlite] sqlite3_prepare_v2(pDb, stmt, -1, &pReadStmt, 0) for read 
the table

Here is what I had:
pDb is the  sqlite3 *pDb which is point to my current database
First statement :
    sqlSt= sqlite3_exec(pDb,"ATTACH DATABASE 'CommonDB' AS CDB ;" , NULL, 0, 
&errMsg);
Second Statement - Read statement:
    sqlite3_prepare_v2(pDb,stmt,-1,&pReadStmt,0) : SQLITE_ERROR ;
        if (sqlSt != SQLITE_OK ) {
            // Print out the error message
        }
      stmt =  select sum(bytesIn), sum(bytesOut) from compressTable  where  
remoteId in (select remoteId from CDB.remoteWXTable where      
            remoteWXType = 1 ) group by startTime ; 
      The error message return back is: 
          errMsg = no such table: CDB.remoteWXTable

Third detach: 
        sqlSt= sqlite3_exec(pDb,"DETACH DATABASE  CDB ;" , NULL, 0, &errMsg);
      but it didn't go this far. 
Thanks,
JL



----- Original Message ----
From: Igor Tandetnik <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Thursday, April 10, 2008 9:13:38 AM
Subject: Re: [sqlite] sqlite3_prepare_v2(pDb, stmt, -1, &pReadStmt, 0) for read 
the table

Joanne Pham <[EMAIL PROTECTED]> wrote:
> Thanks Igor for the info.
> I have tried to prepare and execute each one seperately but it didn't
> work.

Define "didn't work". What exactly did you do, how did it behave, and 
how did the result differ from your expectations?
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to