BUG #2847: Bug with IN statement

From: "Sandip" <sandip(at)singapore(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2847: Bug with IN statement
Date: 2006-12-21 07:38:52
Message-ID: 200612210738.kBL7cqc8083976@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2847
Logged by: Sandip
Email address: sandip(at)singapore(dot)com
PostgreSQL version: 8.1
Operating system: Windows XP
Description: Bug with IN statement
Details:

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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Sandip G 2006-12-21 07:41:33 NEED URGENT HELP....
Previous Message Alvaro Herrera 2006-12-21 01:20:57 Re: server process exited with exit code -1073741819 on 8.2 Windows