sqlite] primary key in another column
On 1/26/2018 6:20 PM, Roman Fleysher wrote:
> I think I effectively did as you suggested using triggers. I insert NULL into
> the ID column to create a row. This triggers the trigger to run update on the
> table to populate the columns based on the
On 1/26/2018 6:20 PM, Roman Fleysher wrote:
I think I effectively did as you suggested using triggers. I insert NULL into
the ID column to create a row. This triggers the trigger to run update on the
table to populate the columns based on the just created ID. Is this what you
suggested?
of
Richard Damon [rich...@damon-family.org]
Sent: Friday, January 26, 2018 6:50 PM
To: sqlite-users@mailinglists.sqlite.org
Subject: Re: [sqlite] primary key in another column
Couldn't you have it access a view which adds the columns by calculation
rather than the raw table? (and if you have some tables
]
Sent: Friday, January 26, 2018 6:26 PM
To: sqlite-users@mailinglists.sqlite.org
Subject: Re: [sqlite] primary key in another column
One question I have, couldn't you just omit the fileName column from the
able, and compute it in the select query that is getting the data?
On 1/26/18 6:03 PM
...@mailinglists.sqlite.org] on behalf of
Richard Damon [rich...@damon-family.org]
Sent: Friday, January 26, 2018 6:26 PM
To: sqlite-users@mailinglists.sqlite.org
Subject: Re: [sqlite] primary key in another column
One question I have, couldn't you just omit the fileName column from the
able, and compute
One question I have, couldn't you just omit the fileName column from the
able, and compute it in the select query that is getting the data?
On 1/26/18 6:03 PM, Roman Fleysher wrote:
My implementation of "for Each row" requires all columns to be populated. It
is a dumb thing:
forEachRow
From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of
Igor Tandetnik [i...@tandetnik.org]
Sent: Friday, January 26, 2018 6:10 PM
To: sqlite-users@mailinglists.sqlite.org
Subject: Re: [sqlite] primary key in another column
On 1/26/2018 6:03 PM, Roman Fleysher wrote:
>
On 1/26/2018 6:03 PM, Roman Fleysher wrote:
My implementation of "for Each row" requires all columns to be populated. It
is a dumb thing:
You said: After table is filled, an operation "for each row" will... I suggest running this UPDATE
statement at the end of "table is filled", before "an
f
Igor Tandetnik [i...@tandetnik.org]
Sent: Friday, January 26, 2018 5:56 PM
To: sqlite-users@mailinglists.sqlite.org
Subject: Re: [sqlite] primary key in another column
On 1/26/2018 5:47 PM, Roman Fleysher wrote:
> I will use this table as a manager. There will be multiple columns holding
> various
On 1/26/2018 5:47 PM, Roman Fleysher wrote:
I will use this table as a manager. There will be multiple columns holding various file names. The
names can be random, but I want humans to be able to easily inspect. After table is filled, an
operation "for each row" will get files in some columns
qlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of
Igor Tandetnik [i...@tandetnik.org]
Sent: Friday, January 26, 2018 5:33 PM
To: sqlite-users@mailinglists.sqlite.org
Subject: Re: [sqlite] primary key in another column
On 1/26/2018 4:43 PM, Roman Fleysher wrote:
> I would like to use prim
On 1/26/2018 4:43 PM, Roman Fleysher wrote:
I would like to use primary key as a way to create unique column entry:
CREATE TABLE A( id INTEGER PRIMARY KEY, fileName TEXT NOT NULL)
such that file name is always prefix followed by the ID for the content to be:
ID fileName
1 prefix_1
2
Solved with trigger, but I can not use NOT NULL for the fileName column:
CREATE TRIGGER AAA AFTER INSERT ON A
BEGIN
UPDATE A SET fileName = 'prefix'||NEW.id WHERE id=NEW.id;
END;
INSERT INTO A (id) VALUES (NULL);
INSERT INTO A (id) VALUES (NULL);
INSERT INTO A (id) VALUES (NULL);
...
Is that
13 matches
Mail list logo