Subject | Re: [firebird-support] case when .. else ..end |
---|---|
Author | HJ |
Post date | 2005-10-19T11:00:51Z |
polash26 wrote:
when -1 then 'All Users'
when -2 then 'Superuser'
when -3 then 'Unauthenticated Users'
else R.RoleName
end
AS 'RoleName'
>Can any body tell me what is the problem what is the problem in mycase MP.RoleID
>case statement?
>
>CREATE PROCEDURE AAABBB(
> PORTALID INTEGER)
>RETURNS (
> AID INTEGER,
> NAME VARCHAR(50))
>AS
>BEGIN
>FOR SELECT
> MP.RoleID,
> case
> when MP.RoleID = -1 then 'All Users'
> when MP.RoleID = -2 then 'Superuser'
> when MP.RoleID = -3 then 'Unauthenticated Users'
> else R.RoleName
> end
> AS 'RoleName'
>
>
when -1 then 'All Users'
when -2 then 'Superuser'
when -3 then 'Unauthenticated Users'
else R.RoleName
end
AS 'RoleName'
>FROM AAA MPHTH
>LEFT JOIN BBB R ON MP.RoleID = R.RoleID
>INTO :AID, :Name
>DO SUSPEND;
>
>END
>
>
>