Re: [sqlite] IF...THEN constructs

2008-03-03 Thread BareFeet
Hi Jason, > I'm used to doing stored procedures for web apps, which > conditionally execute statements based on state and/or the > presence of variables. As others have pointed out, SQLite doesn't (currently at least) offer stored procedures, so no branching in SQL such as if/then etc. But

Re: [sqlite] IF...THEN constructs

2008-02-28 Thread John Stanton
Sqlite does not have a built in procedural language like PL/SQL. For certain applications we just added Javascript to cover that requirement. It was straightforward using Spidermonkey and had the advantage of being the same language used by the AJAX applications backended by Sqlite so

Re: [sqlite] IF...THEN constructs

2008-02-27 Thread Jason Salas
nice work! Stephen Oberholtzer wrote: > On Wed, Feb 27, 2008 at 6:00 PM, Jason Salas <[EMAIL PROTECTED]> wrote: > >> Hi Igor, >> >> Thanks for the insight. I'm used to doing stored procedures for web >> apps, which conditionally execute statements based on state and/or the >> presence of

Re: [sqlite] IF...THEN constructs

2008-02-27 Thread Jason Salas
shoot. worst suspicions affirmed. :-) although this is for a C# console app, it's still largely client/server and i designed the back-end as such, to reduce roundtrips to the DB. no sweat, a little refactoring won't hurt. thanks again! Igor Tandetnik wrote: > Jason Salas <[EMAIL

Re: [sqlite] IF...THEN constructs

2008-02-27 Thread Stephen Oberholtzer
On Wed, Feb 27, 2008 at 6:00 PM, Jason Salas <[EMAIL PROTECTED]> wrote: > Hi Igor, > > Thanks for the insight. I'm used to doing stored procedures for web > apps, which conditionally execute statements based on state and/or the > presence of variables. Consider this construct, which I built

Re: [sqlite] IF...THEN constructs

2008-02-27 Thread Igor Tandetnik
Jason Salas <[EMAIL PROTECTED]> wrote: > Thanks for the insight. I'm used to doing stored procedures for web > apps There is no such thing as a stored procedure in SQLite. > How would I got about re-writing something like this in SQLite? You wouldn't. You would write the logic in whatever

Re: [sqlite] IF...THEN constructs

2008-02-27 Thread Jason Salas
Hi Igor, Thanks for the insight. I'm used to doing stored procedures for web apps, which conditionally execute statements based on state and/or the presence of variables. Consider this construct, which I built recently to populate a table with URL for a web spider bot I built: CREATE

Re: [sqlite] IF...THEN constructs

2008-02-27 Thread Igor Tandetnik
"Jason Salas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm used to doing lengthy T-SQL programming in SQL Server, so this is > kinda new to me. How does one replicate doing IF...THEN conditional > blocks in SQLite 3? One typically doesn't. Instead, one implements complex

[sqlite] IF...THEN constructs

2008-02-26 Thread Jason Salas
Hi everyone, I'm used to doing lengthy T-SQL programming in SQL Server, so this is kinda new to me. How does one replicate doing IF...THEN conditional blocks in SQLite 3? Is it all nested CASE statements within the SQL statement(s)? Or should I figure out the logic in my client (web,