pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Harpreet Dhaliwal <harpreet.dhaliwal01@gmail.com>
To: Sandip G <sandip@singapore.com>
Cc: pgsql-bugs@postgresql.org
Cc: pgsql-sql@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] NEED URGENT HELP....
Date: Mon, 25 Dec 2006 23:02:17 +0530
Message-ID: <d86a77ef0612250932k15b3a8f1s90ec1c52ef99040b@mail.gmail.com> (raw)
In-Reply-To: <20061221074133.5B05A872DC@cal1-1.us4.outblaze.com>
References: <20061221074133.5B05A872DC@cal1-1.us4.outblaze.com>

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@singapore.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;

view thread (14+ messages)  latest in thread

Message-ID: <d86a77ef0612250932k15b3a8f1s90ec1c52ef99040b@mail.gmail.com>
Permalink:  ../d86a77ef0612250932k15b3a8f1s90ec1c52ef99040b@mail.gmail.com/
Also on:    postgresql.org/message-id/d86a77ef0612250932k15b3a8f1s90ec1c52ef99040b@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: harpreet.dhaliwal01@gmail.com, sandip@singapore.com, pgsql-bugs@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] NEED URGENT HELP....
  In-Reply-To: <d86a77ef0612250932k15b3a8f1s90ec1c52ef99040b@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox