ssage -
From: "Gurjeet Singh"
To: "Martijn van Oosterhout" , "Henrique P Machado" , "Guy Rouillier"
, pgsql-general@postgresql.org, "Sandip G"
Subject: Re: [GENERAL] NEED URGENT HELP
Date: Tue, 26 Dec 2006 20:39:01 +0530
It works M
Martijn van Oosterhout escreveu:
On Mon, Dec 25, 2006 at 08:52:52PM -0300, Henrique P Machado wrote:
WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3)
Could'nt he use an array in this 3rd parameter?
I think so, if it's written:
AND BOOK_NO = ANY($3)
Have a nic
It works Martijn...
but with a few changes will be required in your function Sandip; you will
have to pass an ARRAY constructor and return a SETOF record. Here's a
sample:
postgres=> create table tab ( a int, b int );
CREATE TABLE
postgres=> insert into tab values ( 1, 9 );
INSERT 0 1
postgres=>
On Mon, Dec 25, 2006 at 08:52:52PM -0300, Henrique P Machado wrote:
> WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3)
>
> Could'nt he use an array in this 3rd parameter?
I think so, if it's written:
AND BOOK_NO = ANY($3)
Have a nice day,
--
Martijn van Oosterhout
WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3)
Could'nt he use an array in this 3rd parameter?
--
ZehRique
Sandip G wrote:
> WHERE (USER_ID = $1) AND (COMPANY_ID = $2) AND BOOK_NO IN ($3)
> select * from sp_get_phase ('sandip', 'oms', '1,4') this return a
> Blank record.
$3 is a parameter marker for a single value. You cannot supply a
comma-separated list of values and expect it
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
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