Yup...that's it...thought the example was "complete".


Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Pavel Ivanov [paiva...@gmail.com]
Sent: Tuesday, November 22, 2011 2:55 PM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] Time comparisen and CASE WHEN

> How come my sqlite can't recognize this statement?  It's not showing as 
> completed and I don't see why.

Maybe there should be semicolon after update statement (i.e. after END
belonging to CASE)?


Pavel


On Tue, Nov 22, 2011 at 3:50 PM, Black, Michael (IS)
<michael.bla...@ngc.com> wrote:
> How come my sqlite can't recognize this statement?  It's not showing as 
> completed and I don't see why.
>
>
>
> Using 3.7.9 with default options.
>
>
>
> sqlite> CREATE TRIGGER tableA _InsertUpdate
>   ...>     AFTER INSERT
>   ...>     ON tableA
>   ...>  begin
>   ...>    update tableB
>   ...>    set
>   ...>     [LowestTime] = CASE WHEN ( [LowestTime] IS NULL ) OR
>   ...>  ([LowestTime]>  TIME(NEW.TimeStamp)) THEN TIME(NEW.[TimeStamp]) ELSE  
> [LowestTime] END
>   ...> end;
>   ...>
>
>
>
> Michael D. Black
>
> Senior Scientist
>
> Advanced Analytics Directorate
>
> Advanced GEOINT Solutions Operating Unit
>
> Northrop Grumman Information Systems
>
> ________________________________
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
> behalf of Steffen Mangold [steffen.mang...@balticsd.de]
> Sent: Tuesday, November 22, 2011 2:44 PM
> To: General Discussion of SQLite Database
> Subject: EXT :Re: [sqlite] Time comparisen and CASE WHEN
>
> Now I fixed it.
>
> CREATE TRIGGER tableA _InsertUpdate
>    AFTER INSERT
>    ON tableA
>  begin
>   update tableB
>   set
>    [LowestTime] = CASE WHEN ( [LowestTime] IS NULL ) OR
>  ([LowestTime]>  TIME(NEW.TimeStamp)) THEN TIME(NEW.[TimeStamp]) ELSE  
> [LowestTime] END
> end;
>
> ... THEN TIME(NEW.[TimeStamp]) - was the key.
>
> If I format a field with "type" 'time' my sqlite db tool only show me the 
> time, even if I put in a hole datetime.
> But I seems that sqlite also wrote the hole datetime in the field!
>
> THANK YOU IGOR!!!!!
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to