Цитат на писмо от Gerry Snyder <[EMAIL PROTECTED]>:

Dear Gerry,

> >
> It works for me.
>
> How do you know it fails? Do you get an error message? If
> so, what???????
>
> Do you have one process creating the memory DB and
> another trying to
> access it?
>
> More details are needed.
ok, here is an eg.
i am using sqlite3.3.2 and the 'main' file is
/* -- test.c
#include <stdio.h>

#include "sqlite3.h"

int main()
{
    sqlite3 *db1, *db2;

    sqlite3_open(":memory:", &db1);
    sqlite3_exec(db1,"CREATE TABLE t1(a TEXT);"
    "INSERT INTO t1 VALUES('xxx');", 0, 0, 0);
    puts(sqlite3_errmsg(db1));
    sqlite3_open("disk.db3", &db2);
    sqlite3_exec(db2,"ATTACH ':memory:' AS mem;"
    "SELECT * FROM mem.t1;", 0, 0, 0);
    puts(sqlite3_errmsg(db2));
    // and vice versa
    sqlite3_exec(db1,"ATTACH 'disk.db3' AS disk_db;"
    "SELECT * FROM disk_db.sqlite_master;", 0, 0, 0);
    puts(sqlite3_errmsg(db1));

    return 0;

}
-- end of test.c */
the result:
not an error
no such table: mem.t1
not an error


and Derrell,

> You need to ATTACH the disk-resident database to the
memory one, rather than
> vice versa as you're trying.  Since you already have the
database handle for
> the memory-resident database, issue an "ATTACH
'diskdatabase.db' AS disk_db;"
>command on the memory-resident database handle.
>
>Derrell

 yes, it works fine, but i need to store the results to the
disk-resident database.

regards
e.


-----------------------------

Slon.bg ™
Симпатичният магазин за
книги, DVD, игри и музика
http://www.slon.bg


Reply via email to