469,326 Members | 1,518 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

How to return table based on if condition in Postgesql

CREATE Procedure [dbo].[GetMstDropdowndata]
@FieldType varchar(100)='Typeid'
AS
BEGIN
if @FieldType='IsOptionalid'
BEGIN
SELECT 'Yes' as ddlvalue,'Yes' AS ddltext
union
SELECT 'No' as ddlvalue,'No' AS ddltext
END
else if @FieldType='Categoryid'
BEGIN
select [CategoryId] as ddlvalue ,[CategoryName] as ddltext
from [CategoryMaster] order by CategoryName
END
END

How to convert above sp in Postgresql
4 Weeks Ago #1
0 2722

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Sreeneet | last post: by
6 posts views Thread by dummie_q | last post: by
16 posts views Thread by Malcolm McLean | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.