2010 13:34
To: General Discussion of SQLite Database
Subject: Re: [sqlite] BEFORE INSERT TRIGGER
> Like I said, I don't see anything wrong with it, and in fact it works for
me. I suspect the problem lies elsewhere, in a statement you didn't show.
One that actually contains a double quote i
> Like I said, I don't see anything wrong with it, and in fact it works for me.
> I suspect the problem lies elsewhere, in a statement you didn't show. One
> that actually contains a double quote in it, perhaps?
In fact it's not double quote, it should be extra endline character I think.
Tareq Khan wrote:
> Thanks for the reply. Yes I am aware of that... I have just updated to the
> latest version. However I would be grateful if someone could tell me what
> was wrong with the trigger I was trying to create.
Like I said, I don't see anything wrong with it,
-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: 10 June 2010 13:13
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] BEFORE INSERT TRIGGER
Tareq Khan <tk...@quantinity.com> wrote:
> I have looked through the list with rega
Tareq Khan wrote:
> I have looked through the list with regards to my issue and there are
> several entries that say that the following is correct for a BEFORE INSERT
> trigger:
>
>
>
> CREATE TRIGGER AlbumSectionInsertTrigger
> BEFORE INSERT
> ON AlbumSection
> FOR
Hi
I have looked through the list with regards to my issue and there are
several entries that say that the following is correct for a BEFORE INSERT
trigger:
CREATE TRIGGER AlbumSectionInsertTrigger
BEFORE INSERT
ON AlbumSection
FOR EACH ROW
BEGIN
SELECT CASE
WHEN
Hi.
I would like to put an insert trigger on a table A before the
insert where the insert only happens if the values in the new
row meet certain conditions.
I can achieve the same result by having the trigger run after
the insert on Table A and delete the newly inserted row if the
row does not
Alex wrote:
Yes, what about firing the DELETE trigger? During REPLACE a row is deleted,
isn't it?
That's the way REPLACE works, yes. So one could reasonably argue for
a DELETE trigger to fire on a REPLACE.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
> >I do not consider this a bug. INSERT OR REPLACE is not an UPDATE so
> >an UPDATE trigger should not fire on an INSERT OR REPLACE. So don't
> >be looking for me to change it anytime soon.
> >
>
> I was thinking more along the lines of a DELETE. That would be an accurate
> semantic, would it
Christian Smith wrote:
I was thinking more along the lines of a DELETE. That would be an accurate
semantic, would it not?
Yes.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
On Tue, 12 Oct 2004, D. Richard Hipp wrote:
>Christian Smith wrote:
>>
>> If this issue is critical to your project, you should perhaps contract
>> Richard to do the changes, as I can't give any guarantees on ever getting
>> round to implementing this. I'm still in the code familiarisation phase.
Christian Smith wrote:
If this issue is critical to your project, you should perhaps contract
Richard to do the changes, as I can't give any guarantees on ever getting
round to implementing this. I'm still in the code familiarisation phase.
I do not consider this a bug. INSERT OR REPLACE is not
On Tue, 12 Oct 2004, Alex wrote:
>Hi
>
>> Existing ticket #368 may cover this behaviour. I guess Ron is the user who
>> added the latest remark:
>> http://www.sqlite.org/cvstrac/tktview?tn=368
>>
>> If I have time at the weekend, I might have a bash at producing a patch
>> that will implement
Hi
> Existing ticket #368 may cover this behaviour. I guess Ron is the user who
> added the latest remark:
> http://www.sqlite.org/cvstrac/tktview?tn=368
>
> If I have time at the weekend, I might have a bash at producing a patch
> that will implement what is required. No promises, mind.
>
> What
On Thu, 23 Sep 2004, Alex wrote:
>> If I have time at the weekend, I might have a bash at producing a patch
>> that will implement what is required. No promises, mind.
>>
>> What would be preferred? Convert the trigger to an update trigger, or fire
>> a delete trigger followed by an insert
> If I have time at the weekend, I might have a bash at producing a patch
> that will implement what is required. No promises, mind.
>
> What would be preferred? Convert the trigger to an update trigger, or fire
> a delete trigger followed by an insert trigger?
>
> I'd prefer the former (update)
On Tue, 21 Sep 2004, Alex wrote:
>> But I think the gist of you email is that you'd prefer the "INSERT OR
>> REPLACE" to be handled like an update. I can't see a reason why an OLD
>> record could be created for replace inserts. The problem then becomes how
>> do you know in the trigger whether
> But I think the gist of you email is that you'd prefer the "INSERT OR
> REPLACE" to be handled like an update. I can't see a reason why an OLD
> record could be created for replace inserts. The problem then becomes how
> do you know in the trigger whether OLD is valid? If the insert is a
>
> CREATE TABLE table (ID text UNIQUE, Name text, Surname text, SecDbKey text)
> INSERT INTO table VALUES ('001', 'John', 'Smith', 'A0B1C2D3')
> INSERT OR REPLACE INTO table VALUES ('001', 'Jane', 'Parker', 'E4F51234')
I'm not sure exactly what relationship you're trying to maintain
between this
On Tue, September 21, 2004 11:26, Christian Smith said:
> On Tue, 21 Sep 2004, Alex wrote:
>
> In which case it might be better to convert the replace insert into an
> update, and use the update trigger which is guaranteed to have valid OLD
> and NEW.
>
> But that is not my decision to make.
On Tue, 21 Sep 2004, Alex wrote:
>Hi, Christian
>
>Thanks for your response. The situation, however, is more complicated.
>Please, consider an example in SQL:
>
>CREATE TABLE table (ID text UNIQUE, Name text, Surname text, SecDbKey text)
>
>INSERT INTO table VALUES ('001', 'John', 'Smith',
"Alex" <[EMAIL PROTECTED]> writes:
> CREATE TABLE table (ID text UNIQUE, Name text, Surname text, SecDbKey text)
>
> INSERT INTO table VALUES ('001', 'John', 'Smith', 'A0B1C2D3')
>
> INSERT OR REPLACE INTO table VALUES ('001', 'Jane', 'Parker', 'E4F51234')
>
> In the given example the "UNIQUE"
Hi, Christian
Thanks for your response. The situation, however, is more complicated.
Please, consider an example in SQL:
CREATE TABLE table (ID text UNIQUE, Name text, Surname text, SecDbKey text)
INSERT INTO table VALUES ('001', 'John', 'Smith', 'A0B1C2D3')
INSERT OR REPLACE INTO table VALUES
Hi,
In my project I have two databases: primary which is an SQLite db, and
secondary which is based on a different engine. A table in the primary db
contains values which are keys for the secondary db. To maintain coherence
of the two databases I use SQLite triggers. The DELETE and UPDATE
24 matches
Mail list logo