Skip site navigation (1) Skip section navigation (2)

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

From: "Harpreet Dhaliwal" <harpreet(dot)dhaliwal01(at)gmail(dot)com>
To: "Sandip G" <sandip(at)singapore(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] NEED URGENT HELP....
Date: 2006-12-25 17:32:17
Message-ID: d86a77ef0612250932k15b3a8f1s90ec1c52ef99040b@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-generalpgsql-sql
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:
>
>  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/adftrclick?redirectid=en-mail_a_01>

In response to

pgsql-sql by date

Next:From: Jan Meyland AndersenDate: 2006-12-25 21:52:03
Subject: Related tables to a view
Previous:From: Michael FuhrDate: 2006-12-24 19:12:51
Subject: Re: Changing character set when the damage is done

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-12-25 20:39:15
Subject: Re: BUG #2862: ERROR: failed to build any 7-way joins
Previous:From: Pavel GolubDate: 2006-12-25 07:50:43
Subject: Re: BUG #2852: User-defined type name begins with the

pgsql-general by date

Next:From: Guy RouillierDate: 2006-12-25 23:45:31
Subject: Re: NEED URGENT HELP....
Previous:From: Sandeep Kumar JakkarajuDate: 2006-12-25 17:05:26
Subject: Re: Has anyone used the libpqxx C++ API for PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group