dbTalk Databases Forums  

[BUGS] NEED URGENT HELP....

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] NEED URGENT HELP.... in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sandip G
 
Posts: n/a

Default [BUGS] NEED URGENT HELP.... - 12-21-2006 , 02:21 PM






This is a multi-part message in MIME format.

--_----------=_1166686893174611
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-2022-jp"

I am using PostgreSql 8.1 with pgAdmin III. OS is XP. this is my
function:

CREATE OR REPLACE FUNCTION sp_get_phase(character varying, character
varying, character varying)
RETURNS ret_dv_sp_get_phase AS
$BODY$
SELECT BOOK_NO, USER_ID, COMPANY_ID, PHASE, UPDATE_USER_ID,
UPDATE_DATE,
AddInfo1, AddInfo2
FROM T_PHASE
WHERE (USER_ID =3D $1) AND (COMPANY_ID =3D $2) AND BOOK_NO IN ($3)
$BODY$
LANGUAGE 'sql' VOLATILE;


When I run
select * from sp_get_phase ('sandip', 'oms', '4') returns 1
record.....this works fine....

select * from sp_get_phase ('sandip', 'oms', '1') returns 1
record.....this also works fine... BUT

select * from sp_get_phase ('sandip', 'oms', '1,4') this return a
Blank record.

I tried to execute the SQL statement from the function

SELECT BOOK_NO, USER_ID, COMPANY_ID, PHASE, UPDATE_USER_ID,
UPDATE_DATE,
AddInfo1, AddInfo2
FROM T_PHASE
WHERE (USER_ID =3D 'testUser') AND (COMPANY_ID =3D 'testCompany') AND
BOOK_NO IN (1,4)

----- This Works fine... returns 2 records. What may be the problem?

Thanks in advance.
Regards,
Sandip.

--=20
__________________________________________________ _
Search for products and services at:
http://search.mail.com


--_----------=_1166686893174611
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="iso-2022-jp"

<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV>
<DIV id=3DintelliTxt>I am using PostgreSql 8.1 with pgAdmin III. OS is XP.<=
/DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV id=3DintelliTxt style=3D"PADDING-RIGHT: 5px; PADDING-LEFT: 5px">this i=
s my function:<BR><BR>CREATE OR REPLACE FUNCTION sp_get_phase(character var=
ying, character varying, character varying)<BR>&nbsp; RETURNS ret_dv_sp_get=
_phase AS<BR>$BODY$<BR>SELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BOOK_NO, US=
ER_ID, COMPANY_ID, PHASE, UPDATE_USER_ID, UPDATE_DATE, <BR>&nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddInfo1, AddI=
nfo2<BR>FROM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;T_PHASE<BR>WHERE &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; (USER_ID =3D $1) AND (COMPANY_ID =3D $2) AND=
BOOK_NO IN ($3)<BR>$BODY$<BR>&nbsp; LANGUAGE 'sql' VOLATILE;<BR><BR><BR>Wh=
en I run <BR>select * from sp_get_phase ('sandip', 'oms', '4') &nbsp; retur=
ns 1 record.....this works fine....<BR><BR>select * from sp_get_phase ('san=
dip', 'oms', '1') &nbsp;returns 1 record.....this also works fine... BUT <B=
R><BR>select * from sp_get_phase ('sandip', 'oms', '1,4') this return a Bla=
nk record.<BR><BR>I tried to execute the SQL statement from the function <B=
R><BR>SELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BOOK_NO, USER_ID, COMPANY_ID=
, PHASE, UPDATE_USER_ID, UPDATE_DATE, <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AddInfo1, AddInfo2<BR>FROM &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;T_PHASE<BR>WHERE &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; (USER_ID =3D 'testUser') AND (COMPANY_ID =3D 'testCompany') A=
ND BOOK_NO IN (1,4)<BR><BR>----- This Works fine... returns 2 records. &nbs=
p; What may be the problem? <BR><BR>Thanks in advance.<BR>Regards,<BR>Sandi=
p.<BR></DIV></DIV></BLOCKQUOTE><BR>

--=20
<a href=3D"http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=3Den-mail_a_=
01" target=3D_blank>
<IMG alt=3D"" src=3D"http://a8-asy.a8ww.net/a8-ads/adftrview?redirectid=3De=
n-mail_i_01" border=3D"0"></A>=20


--_----------=_1166686893174611--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.