dbTalk Databases Forums  

Re: [BUGS] [GENERAL] NEED URGENT HELP....

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


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



Reply
 
Thread Tools Display Modes
  #1  
Old   
Harpreet Dhaliwal
 
Posts: n/a

Default Re: [BUGS] [GENERAL] NEED URGENT HELP.... - 12-25-2006 , 09:22 PM






------=_Part_45854_14539657.1167067937150
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

it would match ur query against '1,4' for the corressponding field in the
table.
do u really have one such value for that field in your table, i mean '1,4'
??
it won't search for 1 and 4 separately if that is what you want your query
to work.

~Harpreet


On 12/21/06, Sandip G <sandip (AT) singapore (DOT) com> wrote:
Quote:
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 = $1) AND (COMPANY_ID = $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 = 'testUser') AND (COMPANY_ID = 'testCompany')
AND BOOK_NO IN (1,4)

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

Thanks in advance.
Regards,
Sandip.



-- <http://a8-asy.a8ww.net/a8-ads/adftrc...d=en-mail_a_01
------=_Part_45854_14539657.1167067937150
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div>select * from sp_get_phase ('sandip', 'oms', '1,4') this return a Blank record</div>
<div>&nbsp;</div>
<div>it would match ur query against '1,4' for the corressponding field in the table.</div>
<div>do u really have one such value for that field in your table, i mean '1,4' ??</div>
<div>it won't search for 1 and 4 separately if that is what you want your query to work.</div>
<div>&nbsp;</div>
<div>~Harpreet<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 12/21/06, <b class="gmail_sendername">Sandip G</b> &lt;<a href="mailto:sandip (AT) singapore (DOT) com">sandip (AT) singapore (DOT) com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<div>
<div>I am using PostgreSql 8.1 with pgAdmin III. OS is XP.</div></div>
<div>&nbsp;</div>
<div>
<div style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px">this is my function:<br><br>CREATE OR REPLACE FUNCTION sp_get_phase(character varying, character varying, character varying)<br>&nbsp; RETURNS ret_dv_sp_get_phase AS<br>$BODY$
<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 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;T_PHASE<br>WHERE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3)
<br>$BODY$<br>&nbsp; LANGUAGE 'sql' VOLATILE;<br><br><br>When I run <br>select * from sp_get_phase ('sandip', 'oms', '4') &nbsp; returns 1 record.....this works fine....<br><br>select * from sp_get_phase ('sandip', 'oms', '1') &nbsp;returns 1 record.....this also works fine... BUT
<br><br>select * from sp_get_phase ('sandip', 'oms', '1,4') this return a Blank record.<br><br>I tried to execute the SQL statement from the function <br><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 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;T_PHASE<br>WHERE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (USER_ID = 'testUser') AND (COMPANY_ID = 'testCompany') AND BOOK_NO IN (1,4)<br><br>----- This Works fine... returns 2 records. &nbsp; What may be the problem?
<br><br>Thanks in advance.<br>Regards,<br>Sandip.<br>&nbsp;</div></div></blockquote><br>-- <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=en-mail_a_01" target="_blank">
<img alt="" border="0"></a> </blockquote></div><br>

------=_Part_45854_14539657.1167067937150--


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.