On Sun, 8 Sep 2013 22:56:20 +, "Joseph L. Casale"
wrote:
>Hi,
>What is the most efficient way to insert several records into a table which
>has a fk ref to the auto incrementing pk of another insert I need to do in the
>same statement.
What is efficient?
> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Gintaras Didzgalvis
> Sent: zondag 8 september 2013 06:32
> To: sqlite-users@sqlite.org
> Subject: [sqlite] SQLite and Virtual PC
>
> Hi,
>
> SQLite running on
On 9 Sep 2013, at 3:36am, Joseph L. Casale wrote:
> That is the procedure I utilize normally, the requirement for this specific
> case is
> that the entire set of inserts into table_a be bundled with their associated
> inserts
> into table_b in one statement where I
You might be able to store your "variable" in a table:
CREATE TABLE table_lastid (id INTEGER);
INSERT INTO table_lastid (id) VALUES(0);
Then in your sequence:
INSERT INTO table_a (val) VALUES ('xx');
UPDATE table_lastid SET id = last_insert_rowid();
INSERT INTO table_b (id, key, val)
val would have to be declared unique (have a unique index) in order for that to
work as intended, otherwise it will insert as many rows as there are duplicate
val values ...
> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On
If you are using a programming language, simply retrieve the id after the first
insert, then bind that host variable when executing subsequent statements.
You can also try something like:
BEGIN IMMEDIATE;
Insert into table1 values ('...');
Insert into table2 (id, key, val)
Select id, key,
> Look up the last_insert_rowid() you want and store it in your programming
> language. That's what programming languages are for. But if you want to do
> it less efficiently ...
Hey Simon,
That is the procedure I utilize normally, the requirement for this specific
case is
that the entire set
On 9 Sep 2013, at 3:17am, Joseph L. Casale wrote:
> INSERT INTO table_a (val) VALUES ('xx');
> INSERT INTO table_b (id, key, val)
> SELECT last_insert_rowid(), 'yyy', 'zzz';
>
> Just not sure how to perform 20 or 30 of those inserts into table_b after the
> If I understand the question, and there is no key other than the
> auto-incrementing
> integer, there might not be a good way. It sounds like the database's design
> may
> have painted you into a corner.
Hi James,
Well, after inserting one row into table A which looks like (without
On Sun, 8 Sep 2013 22:56:20 +
"Joseph L. Casale" wrote:
> What is the most efficient way to insert several records into a table
> which has a fk ref to the auto incrementing pk of another insert I
> need to do in the same statement.
If I understand the question,
Hello Stephen,
My experience is that shared folders under Virtual PC are completely
unreliable. SMB actually works better, other than the fact Sqlite
doesn't seem to like SMB.
C
Sunday, September 8, 2013, 4:46:04 PM, you wrote:
SC> You're using it via a network which is a no-no for
Hi,
What is the most efficient way to insert several records into a table which
has a fk ref to the auto incrementing pk of another insert I need to do in the
same statement.
I am migrating some code away from using the SQLAlchemy orm to using the
Core. The way the data is returned to me is a
You're using it via a network which is a no-no for SQLite. ANY remote
access of a file under any networking infrastructure isn't guaranteed with
SQLite.
On Sun, Sep 8, 2013 at 12:31 AM, Gintaras Didzgalvis <
supp...@quickmacros.com> wrote:
> Hi,
>
> SQLite running on Microsoft Virtual PC 2007
Hi,
SQLite running on Microsoft Virtual PC 2007 cannot read and write
databases that are on host PC.
Details:
sqlite3_open_v2(SQLITE_OPEN_READWRITE) succeeds, but sqlite3_exec
returns SQLITE_BUSY, even with SELECT.
Using the official downloaded sqlite3.dll, version 3.8.0.
OS on guest PC,
Hi!
Has anybody successfully used System.Data.SQLite.Linq in their project and
can perhaps help me with this?
Even after including this DLL in my project reference, it is apparent that
Linq is calling the wrong provider when building the appropriate SQL
statements. It is throwing an exception in
15 matches
Mail list logo