Re: [sqlite] Database merge?

2006-01-26 Thread Darren Duncan
At 11:20 PM -0600 1/26/06, michael munson wrote: I have two databases, one has many fields I need, the other only has one. Is it possible to go through the second database, and update specific rows on the first? DB1 has many rows, and DB2 has some. Every row in DB2 is in DB1 and they both

[sqlite] Database merge?

2006-01-26 Thread michael munson
I have two databases, one has many fields I need, the other only has one. Is it possible to go through the second database, and update specific rows on the first? DB1 has many rows, and DB2 has some. Every row in DB2 is in DB1 and they both have the same value for the key row so they can be

Re: [sqlite] sqlite problem

2006-01-26 Thread Jim Crafton
> try creating an index on functions.symbolid OK, at the risk of sounding stupid, how do I do that? Is that just some new syntax in creating the table? Cheers Jim

Re: [sqlite] Question about locking

2006-01-26 Thread drh
Paul Tomblin <[EMAIL PROTECTED]> wrote: > I'm curious about the duration of locks, specifically when other processes > can get in to do their bit, since SQLite is so different from other > RDBMSes that I've used (Oracle, Sybase, PostgreSQL, MySQL). > > If I have a process that opens a database

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
Jay Sprenkle wrote: Sorry, I misunderstood you. Yes, selecting from one mem db and inserting to another mem db would do the copy. I'd thought of this, but wanted to avoid having to iterate through all the rows and having explicit insert statements for each table, which would require knowledge of

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Jay Sprenkle
> Sorry, I misunderstood you. Yes, selecting from one mem db and inserting > to another mem db would do the copy. > I'd thought of this, but wanted to avoid having to iterate through all > the rows and having explicit insert statements for each table, which > would require knowledge of the schema

[sqlite] Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread [EMAIL PROTECTED]
Hello, I was thinking about a trick that I once used with an Oracle database. To speed up a data transfer from one database to another, I put the redo log files on a RAM disk. I was severely flamed for this unresponsible suggestion but it made things quicker. Later I learned that there exists

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
Gerry Snyder wrote: Randy Graham wrote: It sure would be nice to be able to attach one mem db to another. -Randy Didn't Jay Sprenkle's code do what you wanted? Jay Sprenkle wrote: sqlite> create table x(y text); sqlite> insert into x(y) values('one'); sqlite> select * from x; one

[sqlite] Re: Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Igor Tandetnik
Randy Graham wrote: I'd thought of this, but wanted to avoid having to iterate through all the rows and having explicit insert statements for each table, which would require knowledge of the schema for each table Not really. With a judicial application of sqlite3_column_count and

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Gerry Snyder
Randy Graham wrote: It sure would be nice to be able to attach one mem db to another. -Randy Didn't Jay Sprenkle's code do what you wanted? Jay Sprenkle wrote: sqlite> create table x(y text); sqlite> insert into x(y) values('one'); sqlite> select * from x; one sqlite> attach ":memory:"

[sqlite] Re: Re: Difference between finalize and reset.

2006-01-26 Thread Igor Tandetnik
Yes, you call sqlite3_reset to finish the current query, then just call sqlite3_step to start a new one. Igor Tandetnik nbiggs wrote: Do you just pass the compiled statement back to the step function again? -Original Message- From: Clay Dowling Sent: Thursday, January 26, 2006 2:34

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
Igor Tandetnik wrote: Randy Graham wrote: Igor Tandetnik wrote: Randy Graham <[EMAIL PROTECTED]> wrote: Is it possible to copy tables from one memory database to another without going through an intermediate disk database? Can't you just write a function that would run "select *

[sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Igor Tandetnik
Randy Graham wrote: Igor Tandetnik wrote: Randy Graham <[EMAIL PROTECTED]> wrote: Is it possible to copy tables from one memory database to another without going through an intermediate disk database? Can't you just write a function that would run "select * from table" on one db, and for

RE: [sqlite] Re: Difference between finalize and reset.

2006-01-26 Thread nbiggs
What would be a good example of reusing the statement? Why not just execute the SQL again? -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 26, 2006 12:21 PM To: SQLite Subject: [sqlite] Re: Difference between finalize and reset. nbiggs <[EMAIL

AW: [sqlite] sqlite and index

2006-01-26 Thread Klaus Schären
hi dennis now it works. thanks as lot for your help. klaus -Ursprüngliche Nachricht- Von: Dennis Cote [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 25. Januar 2006 20:50 An: sqlite-users@sqlite.org Betreff: Re: [sqlite] sqlite and index Klaus Schären wrote: >Hi > >i have the

RE: [sqlite] Re: Difference between finalize and reset.

2006-01-26 Thread nbiggs
Thanks -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 26, 2006 12:21 PM To: SQLite Subject: [sqlite] Re: Difference between finalize and reset. nbiggs <[EMAIL PROTECTED]> wrote: > Can somebody please explain the difference between the >

Re: [sqlite] Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
Igor Tandetnik wrote: Randy Graham <[EMAIL PROTECTED]> wrote: Is it possible to copy tables from one memory database to another without going through an intermediate disk database? Can't you just write a function that would run "select * from table" on one db, and for each record build

[sqlite] Re: Difference between finalize and reset.

2006-01-26 Thread Igor Tandetnik
nbiggs <[EMAIL PROTECTED]> wrote: Can somebody please explain the difference between the sqlite3_finalize and sqlite3_reset functions. sqlite3_finalize destroys the statement handle and all internal structures associated with it. The handle is unusable after that. sqlite3_reset clears the

[sqlite] Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Igor Tandetnik
Randy Graham <[EMAIL PROTECTED]> wrote: Is it possible to copy tables from one memory database to another without going through an intermediate disk database? Can't you just write a function that would run "select * from table" on one db, and for each record build and execute an insert

[sqlite] Difference between finalize and reset.

2006-01-26 Thread nbiggs
Can somebody please explain the difference between the sqlite3_finalize and sqlite3_reset functions. Do I just call finalize after calling prepare and step, or do I need to call reset also? Looking at the source code, it looks like the exec function just uses prepare, step and finalize.

Re: [sqlite] How to compile sqlite3 C sample code

2006-01-26 Thread Mike Ashmore
On Jan 26, 2006, at 11:03 AM, [EMAIL PROTECTED] wrote: I'm a novice and after compiled and correctly installed SQLite 3.x, i've tried to compile sample C++ program found in Quickstart page. I've got Linker errors, like follows: /home/etrax/tmp/cckIV5JC.o: In function `main': t.c:(.text+0xd6):

Re: [sqlite] Re: Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Randy Graham
Igor Tandetnik wrote: Jay Sprenkle wrote: Every time you open a :memory: database you get a separate instance, identified only by its sqlite3* handle. I'm not sure if ATTACH would work with :memory:, but even if it does it would just create a new, empty in-memory database, not refer to the

[sqlite] How to compile sqlite3 C sample code

2006-01-26 Thread [EMAIL PROTECTED]
I'm a novice and after compiled and correctly installed SQLite 3.x, i've tried to compile sample C++ program found in Quickstart page. I've got Linker errors, like follows: /home/etrax/tmp/cckIV5JC.o: In function `main': t.c:(.text+0xd6): undefined reference to `sqlite3_open'

Re: [sqlite] Re: Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Jay Sprenkle
> Every time you open a :memory: database you get a separate instance, > identified only by its sqlite3* handle. I'm not sure if ATTACH would > work with :memory:, but even if it does it would just create a new, > empty in-memory database, not refer to the one (of possibly many) you > already have

Re: [sqlite] Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Craig Morrison
Igor Tandetnik wrote: did you try the really obvious way? create table db2.yourtable(...) insert into db2.yourtable select * from db1.yourtable For that to work, one first needs to attach one database to the other. ATTACH command requires a file name. Memory database does not have one.

Re: [sqlite] Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Jay Sprenkle
> For that to work, one first needs to attach one database to the other. > ATTACH command requires a file name. Memory database does not have one. It's not ":memory:"? >From the docs: http://sqlite.org/lang_attach.html Syntax of the command: ATTACH DATABASE sql-statement ::= ATTACH

[sqlite] Re: Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Igor Tandetnik
Jay Sprenkle wrote: Is it possible to copy tables from one memory database to another without going through an intermediate disk database? did you try the really obvious way? create table db2.yourtable(...) insert into db2.yourtable select * from db1.yourtable For that to work, one first

Re: [sqlite] Copy tables from one memory database to another with no disk access?

2006-01-26 Thread Jay Sprenkle
> Is it possible to copy tables from one memory database to another > without going through an intermediate disk database? did you try the really obvious way? create table db2.yourtable(...) insert into db2.yourtable select * from db1.yourtable