Re: [sqlite] Trigger Logic!!!

2013-07-22 Thread techi eth
Thanks for quick answer. Yes,I understand i may no be able do inter process communication but calling process can be register for call back (function register to sqlite3_create_function()) on trigger & do whatever required . Cheers- On Mon, Jul 22, 2013 at 12:09 PM, RSmith

Re: [sqlite] Trigger Logic!!!

2013-07-22 Thread RSmith
There is no way to contact an unknown thread that may or may not be running. This means that any thread you wish to speak to needs to be registered somehow in some list and have a means of "listening" to you, which in turn means SQLite (or indeed any other RDBMS) cannot simply notify one or more

Re: [sqlite] Trigger Logic!!!

2013-07-21 Thread Peter Aronson
If you write a function in C, and register it with sqlite3_create_function (or one of its variants), you can then have a trigger like so: CREATE TRIGGER Event_test1 AFTER INSERT ON test BEGIN SELECT my_notifier_function(); END; And since it's a C function, you can do pretty much anything

[sqlite] Trigger Logic!!!

2013-07-21 Thread techi eth
I want to create a trigger on INSERT & in trigger logic I want to notify other running executable in system. Can I do this using trigger operation? Example: Create table (); CREATE TABLE test ( ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, ); CREATE TRIGGER Event_test1 AFTER INSERT

Re: [sqlite] Trigger logic with INSERT OR REPLACE

2012-11-15 Thread kyan
On Wed, Nov 14, 2012 at 6:01 PM, Simon Slavin wrote: > It's also worth knowing about > > UPDATE OR REPLACE > > which is similarly not MERGE, but has more MERGE-like behaviour. Though what > it does I had to figure out myself since the documentation on the 'UPDATE' > page

Re: [sqlite] Trigger logic with INSERT OR REPLACE

2012-11-14 Thread Simon Slavin
On 14 Nov 2012, at 3:17pm, kyan wrote: > PS: Because of this the INSERT OR REPLACE statement cannot be > considered logically equivalent to MSSQL or ORACLE's MERGE statement > (http://en.wikipedia.org/wiki/Merge_%28SQL%29) which IMHO should be > added to SQLite at some

Re: [sqlite] Trigger logic with INSERT OR REPLACE

2012-11-14 Thread kyan
> No. INSERT OR REPLACE does an INSERT, possibly after doing a DELETE. It > never does an UPDATE. http://www.sqlite.org/lang_conflict.html Similarly any detail rows that are linked with foreign keys to the affected row will be handled according to the FK's ON DELETE clause. For instance if

Re: [sqlite] Trigger logic with INSERT OR REPLACE

2012-11-14 Thread Daniel Polski
Ok thanks! Simon Slavin skrev 2012-11-14 16:04: On 14 Nov 2012, at 2:58pm, Daniel Polski wrote: If I have a value in a table, and use INSERT OR REPLACE to update the value, a trigger created with AFTER UPDATE ON won't fire. Shouldn't an INSERT OR REPLACE to a table

Re: [sqlite] Trigger logic with INSERT OR REPLACE

2012-11-14 Thread Simon Slavin
On 14 Nov 2012, at 2:58pm, Daniel Polski wrote: > If I have a value in a table, and use INSERT OR REPLACE to update the value, > a trigger created with AFTER UPDATE ON won't fire. Shouldn't an INSERT OR > REPLACE to a table which already contain data which are beeing

[sqlite] Trigger logic with INSERT OR REPLACE

2012-11-14 Thread Daniel Polski
Hello, If I have a value in a table, and use INSERT OR REPLACE to update the value, a trigger created with AFTER UPDATE ON won't fire. Shouldn't an INSERT OR REPLACE to a table which already contain data which are beeing replaced be considered an "update" of the table? CREATE table t1 (