SQLite: how to open existing database in memory

Glen Bojsza gbojsza at gmail.com
Sat Oct 17 10:57:18 EDT 2015


I think we have a disconnect...

I want to open an existing database but in memory.

You are saying that I opened a new database in memory but need to create
tables in it.

So I guess the question is better put:

Can you open an existing base in memory if so how?

If you can't open an existing database in memory then if you create a new
one in memory can you copy the tables from an existing one into the
database that is in memory?

On Sat, Oct 17, 2015 at 10:36 AM, Peter Haworth <pete at lcsql.com> wrote:

> You created a database but you didn't create any tables in it. You'll need
> to issue a CREATE TABLE command after opening the db.
>
> On Sat, Oct 17, 2015, 7:22 AM Glen Bojsza <gbojsza at gmail.com> wrote:
>
> > I am trying to open an existing SQLite database in memory.
> >
> > When I do this (or think I do this) I get a database connection ID but
> the
> > it errors out when I try just to show the current data?
> >
> > On OS X Mavericks LC 8 DP4
> >
> > *on* mouseUp
> >
> >    *put* "/Users/Dev/Documents/Ratings.db3:memory:" into tDatabasePath
> >
> >    *put* revOpenDatabase("sqlite", tDatabasePath, , , , ) into
> tDatabaseID
> >
> >    *put* "Connection = " & tDatabaseID  -- if I get an integer then a
> > database connection has been made
> >
> >    *put "SELECT * from Movies" into tSQL*
> >
> >    *put* revDataFromQuery(tab,*return*,tDatabaseID,tSQL) into myresults
> >
> >    *put* myresults
> >
> >    revCloseDataBase tDatabaseID
> >
> > *end* mouseUp
> >
> >
> > My output:
> >
> > Connection = 1         (shows I have a database connection)
> >
> > revdberr,Database Error: no such table: Movies
> >
> >
> > Any suggestions?
> >
> > thanks,
> >
> > Glen
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list