Re: [SQL] How to convert SQL store procedure to Postgresql function

2012-02-28 Thread Leif Biberg Kristensen
Tirsdag 28. februar 2012 12.56.46 skrev Rehan Saleem : > hi , > whats wrong with this function , i am getting syntax error which is syntax > error at or near "+=" LINE 13: set sql += ' bpoverlap, centredistance You can't concatenate that way in plpgsql. Instead of "set sql +=" try with just "||

Re: [SQL] How to convert SQL store procedure to Postgresql function

2012-02-28 Thread Rehan Saleem
ce<>'') set sql += ' and (centredistance<=' + centre_distance + ' or ' + centre_distance + '=1) ' set sql += ' order by chr_u, start_u' exec(sql) end; $BODY$ language plpgsql; ________ Fr

Re: [SQL] How to convert SQL store procedure to Postgresql function

2012-02-28 Thread Rehan Saleem
; $BODY$ language plpgsql; ________ From: Filip Rembiałkowski To: Rehan Saleem Cc: "pgsql-sql@postgresql.org" Sent: Tuesday, February 28, 2012 3:36 PM Subject: Re: [SQL] How to convert SQL store procedure to Postgresql function On Tue, Feb 28, 2012 at

Re: [SQL] How to convert SQL store procedure to Postgresql function

2012-02-28 Thread Filip Rembiałkowski
On Tue, Feb 28, 2012 at 9:50 AM, Rehan Saleem wrote: > hi , > how can i convert this sql store procedure to postgresql function , i shall > be very thankful to you, as i am new to postgresql and i dont know how to > handle this kind of store procedure in postgresql Most people handle this with u

[SQL] How to convert SQL store procedure to Postgresql function

2012-02-28 Thread Rehan Saleem
hi , how can i convert this sql store procedure to postgresql function , i shall be very thankful to you, as i am new to postgresql and i dont know how to handle this kind of store procedure in postgresql thanks ALTERPROCEDURE [dbo].[sp_GetUserByID]   @UserId varchar(50),   @KBId  varch