RE: [firebird-support] sp case statement

2012-11-02 Thread Svein Erling Tysvær
>I guess my question wasn't very clear. What I'm trying to do is have >conditional logic in the where clause. > >pseudo code: > >Select * from table T >Where > Case :input_code >when 'A' then > T.somefield = 'A' >when 'B' then > t.somefield = 'B' >else /* else we

RE: [firebird-support] sp case statement

2012-11-01 Thread Raith,Daniel
ltiple input parameters and the where clause will get more complex. Do I have to live with having the stored procedure check every record in my example? Daniel -Original Message- From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of Alan J Davie

Re: [firebird-support] sp case statement

2012-10-31 Thread Alan J Davies
No. You have some errors in the logic and data types. You can try this. You will get one record returned for every record in your table. CREATE OR ALTER PROCEDURE GET_DATA ( Input_code char(1) ) RETURNS ( Output_code char(1) ) /* you have an integer which will fail */ as begin for select ca