Hi Sam Carleton wrote:
> This is my first BEFORE INSERT trigger in SQLite and I am getting an
> error:
>
> SQL error: near "new": syntax error
> CREATE TRIGGER ti_Customer BEFORE INSERT ON Customer
> BEGIN
> new.instertedon = DATETIME('NOW');
> new.updatedon = new.instertedon;
>
"J. King" wrote in
message news:op.utpribw4tiq...@odin
> On Sat, 09 May 2009 14:37:56 -0400, Igor Tandetnik
> wrote:
>
>> You have two options. You can have an AFTER INSERT trigger that
>> updates the freshly inserted record with your desired values. Or,
On Sat, 09 May 2009 14:37:56 -0400, Igor Tandetnik
wrote:
> You have two options. You can have an AFTER INSERT trigger that updates
> the freshly inserted record with your desired values. Or, you can have a
> BEFORE INSERT trigger that inserts the values you want, then
"Sam Carleton"
wrote in message
news:8d38ca0a0905090811g7415ebereb4eb241a44e4...@mail.gmail.com
> This is my first BEFORE INSERT trigger in SQLite and I am getting an
> error:
>
> SQL error: near "new": syntax error
>
> My goal is that on an insert only the insertedby
Actually that will not work the long term. I am going to have a
update trigger to do the same basic thing and default values will not
work there;) I would also really like to enforce on insert that both
inserter and updater be the same.
Sam
On 5/9/09, Swithun Crowe
2009/5/9 Sam Carleton :
> This is my first BEFORE INSERT trigger in SQLite and I am getting an error:
>
> SQL error: near "new": syntax error
>
> My goal is that on an insert only the insertedby value is provide.
> The trigger will set that to the updatedby, insertedon
According to the syntax of CREATE TRIGGER statement you can use in the
trigger body only insert/update/delete/select statements. There's no
support of simple assignments or any other programming language
extensions.
Pavel
On Sat, May 9, 2009 at 11:11 AM, Sam Carleton
Hello
SC My goal is that on an insert only the insertedby value is provide. The
SC trigger will set that to the updatedby, insertedon and updatedon
SC fields. I searched the web and the only examples I could find was of
SC an AFTER INSERT, am I better off with that approach? I would think
This is my first BEFORE INSERT trigger in SQLite and I am getting an error:
SQL error: near "new": syntax error
My goal is that on an insert only the insertedby value is provide.
The trigger will set that to the updatedby, insertedon and updatedon
fields. I searched the web and the only
9 matches
Mail list logo