Hi Basil,
The first use of IF is same syntax as the case statement so I don't think it is 
required and as IF isn't SQL92 I doubt it will be included

so your command is replaced by

case when (select count(*) from foo) = 100 then 'good' else 'bad' end 

I like the idea of exist but then again you can do this (in a query) count 
where (Select count(*) from foo where col1 ='a') = 1

but what I really think you are talking about is a command language like TSQL for 
Microsoft or P/SQL for Oracle (is it P/SQL what ever?)  At the moment you can't do 
that type of thing is SQLite.  I think the reason here is the it is a Database system 
that is included in your application and therefore you application can make these 
decisions far better that a SQL language

Greg O
Don't for get www.SQL-Scripts.Com

  ----- Original Message ----- 
  From: [EMAIL PROTECTED] 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, April 14, 2004 8:03 AM
  Subject: [sqlite] Adding SQL commands


  I would like to add some commands to SQLite to make my SQL(ite) programming
  life easier!!!
  The commands are:
  IF - e.g IF ((select count(*) from foo) = 100)
  select "good";
     ELSE
              select "bad";
     END

  EXISTS - e.g IF EXISTS(select * from sqlite_master where name =
  'foo')
  DROP TABLE foo;
  END

  local variables - e.g. DECLARE @var TEXT;
       select @var = name from foo;

  I am not familiar with how compilers work but would be willing to write the
  "c" code
  to make these commands work.

  Does anyone have a simple way to add a command using the lemon parser??? I
  find the documentation
  hard to understand and I would like to add these command s using the c++
  compiler from Visual Studio.Net

  B.Thomas



  ------------------------------------------------------------This e-mail may be
  privileged and/or confidential, and the sender does not waive any related
  rights and obligations. Any distribution, use or copying of this e-mail or the
  information it contains by other than an intended recipient is unauthorized.
  If you received this e-mail in error, please advise me (by return e-mail or
  otherwise) immediately. 

  Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce
  pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation
  ou copie de ce message ou des renseignements qu'il contient par une personne
  autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez
  ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par
  retour de courrier électronique ou par un autre moyen.

  ============================================================

Reply via email to