Hi Keith,
Thanks for the reply.
On Mon, Dec 2, 2019 at 6:31 PM Keith Medcalf wrote:
> Well, of course the trigger did not fire. You created an AFTER UPDATE
> trigger, but only did an insert. So of course one would not expect the
> trigger to fire.
You're right- this was a copy/paste error i
On Monday, 2 December, 2019 17:10, Stephen F. Booth wrote:
>I have been trying out generated column support in the 3.31.0 prerelease.
>Thank you for adding such a useful feature!
>When I create a trigger for an update of a generated column the trigger
>is successfully created but it never fires
I have been trying out generated column support in the 3.31.0 prerelease.
Thank you for adding such a useful feature!
When I create a trigger for an update of a generated column the trigger is
successfully created but it never fires. I could not find any mention in
the draft documentation of gener
On Tue, 11 Nov 2014 17:15:53 -0600
Ben Newberg wrote:
> CREATE TRIGGER t_populate_zweeks
> AFTER UPDATE ON zSPs WHEN new.Procedure = 6 AND new.Flag = 1
> BEGIN
> DELETE FROM zWeeks;
> WITH RECURSIVE Weeks(wk) as (select 1 union all select wk + 1 from
> Weeks limit 10)
> INSERT INTO zWeeks (Week)
On Tue, Nov 11, 2014 at 9:01 PM, Igor Tandetnik wrote:
> On 11/11/2014 8:37 PM, Richard Hipp wrote:
>
>> On Tue, Nov 11, 2014 at 8:22 PM, Igor Tandetnik
>> wrote:
>>
>> On 11/11/2014 6:15 PM, Ben Newberg wrote:
>>
>>>
>>> Looks like a bug to me. The statement works standalone, but not within a
>
On 11/11/2014 8:37 PM, Richard Hipp wrote:
On Tue, Nov 11, 2014 at 8:22 PM, Igor Tandetnik wrote:
On 11/11/2014 6:15 PM, Ben Newberg wrote:
Looks like a bug to me. The statement works standalone, but not within a
trigger.
There are many limitations and restrictions on the statements inside
Thanks everyone. I will have the programming language do the work on this
one instead of going the trigger route.
On Nov 11, 2014 7:39 PM, "Richard Hipp" wrote:
> On Tue, Nov 11, 2014 at 8:22 PM, Igor Tandetnik
> wrote:
>
> On 11/11/2014 6:15 PM, Ben Newberg wrote:
> >
> > Looks like a bug to me
On Tue, Nov 11, 2014 at 8:22 PM, Igor Tandetnik wrote:
On 11/11/2014 6:15 PM, Ben Newberg wrote:
>
> Looks like a bug to me. The statement works standalone, but not within a
> trigger.
>
There are many limitations and restrictions on the statements inside of
triggers. See the trigger documentat
On 11 Nov 2014, at 11:59pm, Ben Newberg wrote:
> The 10 is just an arbitrary value I chose for this example. The user
> actually determines the value at run-time, so this value could be any
> integer. I have a way to settle that, if only I could figure out how I can
> get this trigger working.
On 11/11/2014 6:15 PM, Ben Newberg wrote:
CREATE TRIGGER t_populate_zweeks
AFTER UPDATE ON zSPs WHEN new.Procedure = 6 AND new.Flag = 1
BEGIN
DELETE FROM zWeeks;
WITH RECURSIVE Weeks(wk) as (select 1 union all select wk + 1 from Weeks
limit 10)
INSERT INTO zWeeks (Week) select wk from Weeks;
END;
Thanks Simon.
The 10 is just an arbitrary value I chose for this example. The user
actually determines the value at run-time, so this value could be any
integer. I have a way to settle that, if only I could figure out how I can
get this trigger working.
BEN
On Tue, Nov 11, 2014 at 5:41 PM, Simon
On 11 Nov 2014, at 11:15pm, Ben Newberg wrote:
> WITH RECURSIVE Weeks(wk) as (select 1 union all select wk + 1 from Weeks
> limit 10)
> INSERT INTO zWeeks (Week) select wk from Weeks;
Just use 10 INSERT commands.
I don't know what's causing your error message, but your code will be simpler
if
All,
Is it possible to have CTE's within triggers? The way I read the 'SQL As
Understood By SQLite', one can, but I could be misinterpreting it.
My DDL for my trigger is as follows:
CREATE TRIGGER t_populate_zweeks
AFTER UPDATE ON zSPs WHEN new.Procedure = 6 AND new.Flag = 1
BEGIN
DELETE FROM zW
Perfect! Always new nuggets of goodness discovered in sqlite. Thanks!
Josh
On Sat, Dec 7, 2013 at 1:45 PM, Joshua Grauman wrote:
Is there a way to prevent changes to the schema, while still allowing
inserts of new data to existing tables?
The sqlite3_set_authorizer() interface (
http://w
On Sat, Dec 7, 2013 at 1:45 PM, Joshua Grauman wrote:
>
> Is there a way to prevent changes to the schema, while still allowing
> inserts of new data to existing tables?
>
The sqlite3_set_authorizer() interface (
http://www.sqlite.org/c3ref/set_authorizer.html) can register a callback
that preve
On Sat, Dec 7, 2013 at 8:45 PM, Joshua Grauman wrote:
> Ok, so now I have a new question.
>
> Is there a way to prevent changes to the schema, while still allowing
> inserts of new data to existing tables? I'd love to just prevent any
> changes to sqlite_master for a given database connection. I
Ok, so now I have a new question.
Is there a way to prevent changes to the schema, while still allowing
inserts of new data to existing tables? I'd love to just prevent any
changes to sqlite_master for a given database connection. I tried adding
triggers to it similar to the ones I used below,
Nevermind, I found the recursive_triggers PRAGMA...
Thanks!
Josh
Hello all,
I'm trying to create simple permissions for a table to prevent unwanted
modification of certain table rows. I'm brand new to Triggers, but I almost
have what I want working. Imagine I have a table t1 with some data,
Hello all,
I'm trying to create simple permissions for a table to prevent unwanted
modification of certain table rows. I'm brand new to Triggers, but I
almost have what I want working. Imagine I have a table t1 with some data,
and a permission integer. I have two triggers that prevent modifica
On 6/03/2013 1:59 AM, Jay A. Kreibich wrote:
> In this case, it is any trigger that invokes any other trigger.
> Prior to 3.6.18 there was no trigger "stack" and triggers could be
> only one layer deep.
Ah, thanks. That solves the problem. I can dynamically generate a single
inefficient trigg
On 03/05/2013 09:59 PM, Jay A. Kreibich wrote:
On Tue, Mar 05, 2013 at 11:20:27PM +1100, Philip Warner scratched on the wall:
On 5/03/2013 9:53 PM, Richard Hipp wrote:
Recursive triggers (triggers that invoke themselves either directly or
indirectly) were added in version 3.6.18, 2009-09-11.
On Tue, Mar 05, 2013 at 11:20:27PM +1100, Philip Warner scratched on the wall:
> On 5/03/2013 9:53 PM, Richard Hipp wrote:
> > Recursive triggers (triggers that invoke themselves either directly or
> > indirectly) were added in version 3.6.18, 2009-09-11.
>
> These are not strictly recursive; the
On 5/03/2013 9:53 PM, Richard Hipp wrote:
> Recursive triggers (triggers that invoke themselves either directly or
> indirectly) were added in version 3.6.18, 2009-09-11.
These are not strictly recursive; the 'when' clause means that trigger 1 will
cause trigger 2 to be called etc.
_
On Tue, Mar 5, 2013 at 1:11 AM, Philip Warner wrote:
>
> What I am seeing in 3.5.9 on Android is that the triggers are executed
> precisely once each, rather than once for each row.
>
Recursive triggers (triggers that invoke themselves either directly or
indirectly) were added in version 3.6.18,
This is a question about triggers in version 3.5.9...if anyone remembers it.
The reason I am asking is that I want to support
Android 2.1, which has 3.5.9 installed by default.
I have a set of triggers on a table:
tg1 before insert on sometable when new.f1 = 3
insert into sometable(f1, ...)
On Fri, Jun 15, 2012 at 12:42:45PM +, Black, Michael (IS) scratched on the
wall:
> But as somebody pointed out if you muck with database from the shell or
> any other program it will die with "function not found" if the trigger
> is called.
>
> Ergo a dummy function to make it happy and non-f
Black, Michael (IS) wrote:
> Looks like that is getting close...but when is this called? BEFORE or AFTER?
After, as far as I can tell.
--
Igor Tandetnik
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/list
Operating Unit
Northrop Grumman Information Systems
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on
behalf of Igor Tandetnik [itandet...@mvps.org]
Sent: Friday, June 15, 2012 8:15 AM
To: sqlite-users@sqlite.org
Subject: EXT :Re: [sqlite] Tri
Bageesh.M.Bose wrote:
> Can anyone tell "How to use Triggers in Sqlite using C"
What do you mean by "use triggers", exactly? What are you trying to achieve?
If you are asking how to create a trigger, then it's the same way as creating a
table - you open a database connection (with sqlite3_open
Black, Michael (IS) wrote:
> Could the SQLite code add a new dummy function for a callback which we can
> then override with our own library?
sqlite3_update_hook
--
Igor Tandetnik
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.or
se
Subject: EXT :Re: [sqlite] Triggers in Sqlite using C
On Fri, Jun 15, 2012 at 12:12:22PM +, Black, Michael (IS) scratched on the
wall:
> Could the SQLite code add a new dummy function for a callback which
> we can then override with our own library?
Just use an SQL function:
h
On Fri, Jun 15, 2012 at 12:12:22PM +, Black, Michael (IS) scratched on the
wall:
> Could the SQLite code add a new dummy function for a callback which
> we can then override with our own library?
Just use an SQL function:
http://sqlite.org/c3ref/create_function.html
-j
--
Jay A. Kr
atabase
Subject: EXT :Re: [sqlite] Triggers in Sqlite using C
On Fri, Jun 15, 2012 at 11:59:33AM +0530, Bageesh.M.Bose wrote:
> Can anyone tell "How to use Triggers in Sqlite using C"
>
Triggers in SQLite can only contain SQL DML statements. But, you can
interface with C by definin
On Fri, Jun 15, 2012 at 11:59:33AM +0530, Bageesh.M.Bose wrote:
> Can anyone tell "How to use Triggers in Sqlite using C"
>
Triggers in SQLite can only contain SQL DML statements. But, you can
interface with C by defining functions, then calling those functions
using SQL SELECT command.
For exam
Can anyone tell "How to use Triggers in Sqlite using C"
--
With Regards,
*Bageesh.M.Bose*
**
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> You haven't given the view explicit column names
How ?
> try this instead:
>
> CREATE VIEW my_view AS SELECT table1.type as table1_type, table2.type
> as table2_type FROM
Yes this works on latest version. But I wonder why the other syntax is
not accepted anymore. Because I'll have to rewrite m
> Try NEW."table1.type" and NEW."table2.type"
This works with my old 3.6 version but not on 3.7.8
I still get : Error: no such column: NEW.table1.type
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo
On 10/25/2011 10:59 AM, Sébastien Escudier wrote:
Hello,
I used to do something like this on older sqlite versions :
(this does not really makes sense here, but this is a simplified)
CREATE VIEW my_view AS SELECT table1.type, table2.type FROM table1 INNER
JOIN table2 ON table1.id = table2.id;
On Oct 25, 2011, at 10:59 AM, Sébastien Escudier wrote:
> CREATE TRIGGER my_trigger INSTEAD OF INSERT ON my_view
> BEGIN
> INSERT INTO table1(type) VALUES(NEW.table1.type);
> INSERT INTO table2(type) VALUES(NEW.table2.type);
> END;
>
> ...
>
> Why this syntax does not work anymore ?
You haven'
Hello,
I used to do something like this on older sqlite versions :
(this does not really makes sense here, but this is a simplified)
CREATE VIEW my_view AS SELECT table1.type, table2.type FROM table1 INNER
JOIN table2 ON table1.id = table2.id;
CREATE TRIGGER my_trigger INSTEAD OF INSERT ON my_vi
On Fri, Oct 21, 2011 at 12:31 PM, Pavel Ivanov wrote:
> http://www.sqlite.org/c3ref/last_insert_rowid.html
>
> "If an INSERT occurs within a trigger or within a virtual table
> method, then this routine will return the rowid of the inserted row as
> long as the trigger or virtual table method is
> Because of the trigger's insertion into the second table, should not the
> second select statement return a value of 2 instead of 1 since the last
> insertion occurred in table t_log?
http://www.sqlite.org/c3ref/last_insert_rowid.html
"If an INSERT occurs within a trigger or within a virtual ta
After implementing simple auditing of table changes, last_insert_rowid()
still provides the value I really want even though additional table inserts
are being performed in the background. To illustrate:
CREATE TABLE t (a);
CREATE TABLE t_log (
timestamp DATETIME NULL DEFAULT CURRENT_TIMESTAMP
On 29 September 2010 11:49, wrote:
> Hi,
>
> I have this table:
>
> CREATE TABLE [repo] (
> [code] varchar(20) PRIMARY KEY NOT NULL,
> [klass] varchar(2)
> );
>
> and trying to create this trigger:
>
> CREATE TRIGGER repo_klass
> BEFORE INSERT ON `repo`
> BEGIN
> new.klass = SUBSTR
Hi,
I have this table:
CREATE TABLE [repo] (
[code] varchar(20) PRIMARY KEY NOT NULL,
[klass] varchar(2)
);
and trying to create this trigger:
CREATE TRIGGER repo_klass
BEFORE INSERT ON `repo`
BEGIN
new.klass = SUBSTR(new.code,4,2);
END;
I got this error:
near "new": syntax e
Ok, I will rephrase my question although it appears that the answer is
has been already preconceived. I am writing an abstraction layer to
Sqlite where tables, views, triggers etc are presented as XOTcl
Classes/Objects. If two different scripts access the database and one
of them creates a new tabl
On Tue, Nov 3, 2009 at 1:23 PM, Victor Mayevski wrote:
> Ok, I will rephrase my question although it appears that the answer is
> has been already preconceived. I am writing an abstraction layer to
> Sqlite where tables, views, triggers etc are presented as XOTcl
> Classes/Objects. If two differen
On 3 Nov 2009, at 7:23pm, Victor Mayevski wrote:
> Ok, I will rephrase my question although it appears that the answer is
> has been already preconceived. I am writing an abstraction layer to
> Sqlite where tables, views, triggers etc are presented as XOTcl
> Classes/Objects. If two different scr
Victor Mayevski wrote:
> Ok, I will rephrase my question although it appears that the answer is
> has been already preconceived. I am writing an abstraction layer to
> Sqlite where tables, views, triggers etc are presented as XOTcl
> Classes/Objects. If two different scripts access the database an
2009/8/27 Jarod Tang :
> Hi List users,
>
> In my code, i create two triggers (Trigger_A, Trigger_B) on a table (
> sample_db), but after execution, it's found that Trigger_A is not executed
> correctly ( old.msg_box hasnt be put into table log ). And it seems to me
> that SqlLite invalids the OLD
Hi List users,
In my code, i create two triggers (Trigger_A, Trigger_B) on a table (
sample_db), but after execution, it's found that Trigger_A is not executed
correctly ( old.msg_box hasnt be put into table log ). And it seems to me
that SqlLite invalids the OLD reference after it found it be ref
Hello all,
Is it possible to create a trigger on an attached database? I can't seem
to, so I was wondering whether my trigger SQL is wrong (although it
works if I remove the attached database's name from the table).
The only other way that I see to do what I need would be to create
temporary t
Hello all,
Is it possible to create a trigger on an attached database? I can't seem
to, so I was wondering whether my trigger SQL is wrong (although it
works if I remove the attached database's name from the table).
The only other way that I see to do what I need would be to create
temporary tabl
Hello!
I try this code
create trigger view_objects_update before update on view_objects begin
select RAISE (ABORT,'Row id=' || NEW.id);
end;
but get "SQL error: near "||": syntax error". How can I do it?
Best regards, Alexey.
___
sqlite-users maili
mine when to check for data
> > changes. Of course, this won't tell you _what_ changed, which might
> > not help if you're only watching for a tiny item in a large database.
> >
> >
>
> --
> View this message in context:
&
is won't tell you _what_ changed, which might
> not help if you're only watching for a tiny item in a large database.
>
>
--
View this message in context:
http://www.nabble.com/Accessing-external-applications-from-within-SQLite-triggers-tf
A couple other things come to mind here, that might be relevant to
what you're doing:
* A trigger that has a "final" side effect, like signaling another
process, will both have that effect early (before the transaction is
committed), and will have that effect even if the transaction is later
rolle
you would not have to touch process A.
>
--
View this message in context:
http://www.nabble.com/Accessing-external-applications-from-within-SQLite-triggers-tf4614175.html#a13189204
Sent from the SQLite mailing list
Vladimir Stokic wrote:
I agree that the solution with the semaphore is a very elegant one, but that
still does not solve the problem of having to define the custom function to
be called from the trigger over and over again. On the other hand, if the
function is not going to be called from the tri
context:
http://www.nabble.com/Accessing-external-applications-from-within-SQLite-triggers-tf4614175.html#a13188912
Sent from the SQLite mailing list archive at Nabble.com.
-
To unsubscribe, send email to [EMAIL PROTECTED]
-
If you use a semaphore it is independent of the processes currently
running and has nothing to do with a Sqlite connection. Your custom
function is called, signals the semaphore and exits. When the semaphore
is signalled the process waiting on it is activated.
In your example myfunc performs
On 10/13/07, Vladimir Stokic <[EMAIL PROTECTED]> wrote:
> I tried to do what you and Igor said, but I found out that it does not really
> work that way. I can make a user-defined function, but it stays active only
> while the current connection is open. It is not persisted in the "database".
> Fr
qlite3
> handle which, um, triggers. So if app A makes a change, the trigger
> runs in app A, but not in app B.
>
> You could have a custom function which the trigger invokes to send an
> IPC over to app
r Stokic
--
View this message in context:
http://www.nabble.com/Accessing-external-applications-from-within-SQLite-triggers-tf4614175.html#a13177010
Sent from the SQLite mailing list archive at Nabble.com.
-
To unsubscrib
, but then I
>> learned that sqlite3_update_hook does not work that way.
>>
>> If anyone could help me, I would be very grateful.
>>
>> Thanks in advance,
>> Vladimir Stokic
>> --
>> View this message in context:
>> http://www.nabble.com/Accessing-
qlite3_update_hook does not work that way.
>
> If anyone could help me, I would be very grateful.
>
> Thanks in advance,
> Vladimir Stokic
> --
> View this message in context:
> http://www.nabble.com/Accessing-external-applications-from-within-SQLite-trigg
Vladimir Stokic
wrote:
I would like to know if there is any way to access some external
application from within an SQLite trigger.
Create a custom function doing that, call it from the trigger.
Igor Tandetnik
-
To u
,
Vladimir Stokic
--
View this message in context:
http://www.nabble.com/Accessing-external-applications-from-within-SQLite-triggers-tf4614175.html#a13177010
Sent from the SQLite mailing list archive at Nabble.com.
-
To
Wesley wrote:
As an example: in an instant messenger a new text message arrives. The
application puts it into the message log. The chat window automatically
updates with the new text. The statistics window about total # of
messages updates. Possibly other things happen. The point is I don't
On Feb 15, 2007, at 4:01 PM, [EMAIL PROTECTED] wrote:
"Wesley W. Terpstra" <[EMAIL PROTECTED]> wrote:
The approach I'd much prefer is to register a trigger to update
the GUI...
Note that the trigger runs on the client-side of the process that
makes the change - not on the client side of the p
in our team building Flex
based products. Position is in the Washington D.C. metro area. If interested
contact [EMAIL PROTECTED]
-Original Message-
From: Wesley W. Terpstra [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 15, 2007 9:33 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Triggers+c
On Feb 15, 2007, at 3:46 PM, Michael Schlenker wrote:
Wesley W. Terpstra schrieb:
I intend to write a GUI application backed by SQL. Several of the
windows display status that would best be represented as a
database view. What I've been thinking about is how to update the
GUI when the view
"Wesley W. Terpstra" <[EMAIL PROTECTED]> wrote:
>
> The approach I'd much prefer is to register a trigger to update the
> GUI...
>
Note that the trigger runs on the client-side of the process
that makes the change - not on the client side of the process
that is implementing the GUI.
Neverthele
Wesley W. Terpstra schrieb:
I intend to write a GUI application backed by SQL. Several of the
windows display status that would best be represented as a database
view. What I've been thinking about is how to update the GUI when the
view changes.
[snip]
Thus, a window simply provides the VIEW
I intend to write a GUI application backed by SQL. Several of the
windows display status that would best be represented as a database
view. What I've been thinking about is how to update the GUI when the
view changes.
First the obvious approach: polling. Every X seconds re-execute the
que
Hi all,
I need to have some stored-procedures. I wonder what is the best way to do
it.
SQLite3 does not offer stored-procedures, but it offers:
1. Prepared statements.
2. Triggers.
In my application I often create temporary tables - which change the schema,
at least in the current connection, and
[EMAIL PROTECTED] wrote:
> A user complains in ticket #1689 that SQLite does not
> allow triggers in one database to refer to tables in
> a different database or to TEMP tables.
...
> Should I remove the tests from SQLite that prevent
> triggers in one database from referring to tables in
> a diffe
e IMHO. as for allowing it, well, guns are allowed also, so
you can shoot yourself in the foot, if you really want to.
> -Original Message-
> From: Brad [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 28, 2006 3:28 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [
Should I remove the tests from SQLite that prevent
triggers in one database from referring to tables in
a different database?
Well, I have a couple of triggers in my SQL Server database that refer
to tables in another database, though they are on the same server.
Obviously, I can see some util
I definitely second this since I actually got bitten by this last week :-)
We split over 2 databases for the same reason as Derrell and always attach
after opening them. Surely it's harmless to remove these checks - if something
goes wrong, the trigger will just fail normally with a "no such tab
[EMAIL PROTECTED] writes:
> Should I remove the tests from SQLite that prevent
> triggers in one database from referring to tables in
> a different database? Or should I leave things as
> they are and close ticket #1689 with a remark of
> "works as designed".
I have had use for triggers that cou
A user complains in ticket #1689 that SQLite does not
allow triggers in one database to refer to tables in
a different database or to TEMP tables.
SQLite actually goes to a lot of trouble to detect
these kinds of things since, as we were writing the
code, we could not think of any circumstance whe
Nathan Conrad wrote:
Hi,
I am working on a Linux program written in C. I would like to be able
to set up a trigger that calls a C function so that my application
knows when a certain table has changed so that it can update its UI.
Can this be done? Is there sample code somewhere?
Use sqlite3_create
Hi,
I am working on a Linux program written in C. I would like to be able
to set up a trigger that calls a C function so that my application
knows when a certain table has changed so that it can update its UI.
Can this be done? Is there sample code somewhere?
-Nathan
signature.asc
Description:
On Sat, Sep 18, 2004 at 04:58:53PM -0400, D. Richard Hipp wrote:
> [EMAIL PROTECTED] wrote:
> >I am working with triggers on a field defined in a table
> >as INTEGER PRIMARY KEY. Agreed, triggers are not fully
> >implemented on int primary key; but, I need the autoincrement
> >feature.
> >
> >I
[EMAIL PROTECTED] wrote:
I am working with triggers on a field defined in a table
as INTEGER PRIMARY KEY. Agreed, triggers are not fully
implemented on int primary key; but, I need the autoincrement
feature.
I always get -1. Can I depend on that -1 until this feature
is implemented?
If you spec
I am working with triggers on a field defined in a table
as INTEGER PRIMARY KEY. Agreed, triggers are not fully
implemented on int primary key; but, I need the autoincrement
feature.
I always get -1. Can I depend on that -1 until this feature
is implemented?
Here is an example. There are two
Pix wrote:
> Suppose I've some tables like these:
>
> CREATE TABLE contacts (ID, name, surname);
> CREATE TABLE oldContacts (ID, name, surname);
> CREATE TABLE messages (message, contactID, contactWasDeleted default
> NULL);
>
> I wrote a trigger similar to this:
>
> CREATE TRIGGER OnDeleteContact
At 10:53 AM +0200 6/3/04, Pix wrote:
No... I need the id of the row inserted by the TRIGGER... the
trigger operations should be atomic, so no other db activity should
be a problem...
I still don't think you need last_insert_id. Try this in your trigger:
INSERT INTO OldContacts (ID, name, surn
At 5:38 PM +0200 6/2/04, Pix wrote:
There is a way to have the right last_inserted_rowid() ?
Don't use it. Instead, try substituting the string "old.id" for
"last_insert_rowid()". You already know what the contact id is
because its in "old.id". Moreover, "last_insert_rowid()" is
completely un
Suppose I've some tables like these:
CREATE TABLE contacts (ID, name, surname);
CREATE TABLE oldContacts (ID, name, surname);
CREATE TABLE messages (message, contactID, contactWasDeleted default NULL);
I wrote a trigger similar to this:
CREATE TRIGGER OnDeleteContact BEFORE DELETE ON Contacts
FOR E
On Wed, 26 May 2004, Pix wrote:
>Hi,
>I'm using triggers to perform some operations on my SQLite DB.
>Particularly I'm using them to easily maintain DB coerency (e.g. if I
>delete an item from a table, the trigger will delete all rows from
>another table that are referencig to that item).
>
>My qu
Hi,
I'm using triggers to perform some operations on my SQLite DB.
Particularly I'm using them to easily maintain DB coerency (e.g. if I
delete an item from a table, the trigger will delete all rows from
another table that are referencig to that item).
My question is: how much performant the tri
Try
create trigger itemDelTrg after delete on Items for each row begin
delete from Stats where Stats.ID = old.ID;
end;
Also consider
create trigger statInsTrg before insert on Stats for each row
when (select count(ID) from Items where ID = new.ID) = 0 begin
select raise(ro
I am having trouble getting the exact syntax for a trigger. I'm new to
triggers, so I'm sure this will be easy for some of you.
Table Items:
ID Integer Primary Key
... [rest of fields ]
Tables Stats:
ID
... rest of fields
I want to delete a row in Items and have that trigger the deletion of all
95 matches
Mail list logo