NEED URGENT HELP....

From: "Sandip G" <sandip(at)singapore(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: NEED URGENT HELP....
Date: 2006-12-21 07:41:33
Message-ID: 20061221074133.5B05A872DC@cal1-1.us4.outblaze.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general pgsql-sql

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.

--
___________________________________________________
Search for products and services at:
http://search.mail.com

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tony Marston 2006-12-21 11:28:40 BUG #2848: information_schema.key_column_usage does not work
Previous Message Sandip 2006-12-21 07:38:52 BUG #2847: Bug with IN statement

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2006-12-21 08:05:29 Re: Need help on "org.postgresql.util.PSQLException: FATAL:
Previous Message Wong Jowo 2006-12-21 05:09:58 Need help on "org.postgresql.util.PSQLException: FATAL: terminating connection due to administrator command"

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Stainburn 2006-12-21 09:46:56 Re: join/group/count query.
Previous Message Hector Villarreal 2006-12-20 18:06:29 Re: join/group/count query.