Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id BFA354759A7 for ; Fri, 31 May 2002 01:25:35 -0400 (EDT) Received: from vreach.net (unknown [203.200.123.87]) by postgresql.org (Postfix) with ESMTP id A4D3047591F for ; Fri, 31 May 2002 01:25:25 -0400 (EDT) Received: from lokhi [194.168.2.19] by vreach.mzi.net [194.168.2.30] with SMTP (MDaemon.PRO.v5.0.5.R) for ; Fri, 31 May 2002 10:54:17 +0530 Message-ID: <003501c20863$1c6fd1f0$1302a8c2@multicast.com> From: "Sandeep Chibber" To: Cc: "The Grim Reeper Is Here" , "Naveen Kaul" Subject: Postgres Function Call Problem Date: Fri, 31 May 2002 10:52:08 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0032_01C20891.36036EF0" X-Priority: 1 X-MSMail-Priority: High X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-MDRemoteIP: 194.168.2.19 X-Return-Path: sandeep@vreach.net X-MDaemon-Deliver-To: pgsql-sql@postgresql.org X-Archive-Number: 200206/6 X-Sequence-Number: 7971 This is a multi-part message in MIME format. ------=_NextPart_000_0032_01C20891.36036EF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi , I want to have function which will have a query which will accept a paramet= er from my application and on the basis of the parameter retreive a result = set. Normal call through SELECT gets me an number,i guess some kind of id. In th= e following function i get ouput as something like 168269272 .If there are = three rows in the table then the value will be reapeated three times .I wan= t the value and not an id =20 Table structure is CREATE TABLE ICDN_EVENTREG ( USER_ID VARCHAR(30) NOT NULL , PASSWORD VA= RCHAR(16) , EMAIL VARCHAR(80) , DEPARTMENT VARCHAR(30) , FIRST_NAME VA= RCHAR(30) , LAST_NAME VARCHAR(30) , DESIGNATION VARCHAR(30) , TYPE VAR= CHAR(15) , STATUS VARCHAR(15) DEFAULT 'Pending') ; Function body is as bellow CREATE FUNCTION tester5(varchar, varchar) RETURNS SETOF ICDN_EVENTREG AS 'SELECT user_id,password,email,department,first_name,last_name,designation,= type,status FROM ICDN_EVENTREG WHERE ICDN_EVENTREG.USER_ID = =3D $1 AND ICDN_EVENTREG.PASSWORD =3D $2 ' LANGUAGE 'sql'; I want to Know how 1. How to pass parameter to this function 2. How to call this application 3. In this function i am selecting all the fields , if i want to select only two or three tuples,then how to go about it 4. If have idea about java bean then how to call his function from a Java Bean. Thanks=20 Sandeep ------=_NextPart_000_0032_01C20891.36036EF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi ,

I want to have function which = will have=20 a query which will accept a parameter from my application and on the basis = of=20 the parameter retreive a result set.

Normal call through SELECT gets= me=20 an number,i guess some kind of id. In the following function i get ouput as= =20 something like 168269272 .If there are three rows in the table then the val= ue=20 will be reapeated three times .I want the value and not an id
 
Table structure is

CREATE TABLE=20 ICDN_EVENTREG  (  USER_ID VARCHAR(30) NOT NULL ,   PASS= WORD=20 VARCHAR(16) ,   EMAIL VARCHAR(80) ,  DEPARTMENT VARCHAR(30)= =20 ,   FIRST_NAME VARCHAR(30) ,  LAST_NAME VARCHAR(30)=20 ,    DESIGNATION VARCHAR(30) ,  TYPE VARCHAR(15) , = ;=20 STATUS VARCHAR(15) DEFAULT 'Pending') ;


Function body is as=20 bellow

CREATE FUNCTION tester5(varchar, varchar) RETURNS SETOF=20 ICDN_EVENTREG AS
'SELECT=20 user_id,password,email,department,first_name,last_name,designation,type,sta= tus=20 FROM    ICDN_EVENTREG      &nb= sp;=20 WHERE     ICDN_EVENTREG.USER_ID =3D $1 AND=20 ICDN_EVENTREG.PASSWORD =3D $2 ' LANGUAGE 'sql';

I want to Know how1.=20 How to pass parameter to this function
2. How to call this application3.=20 In this function i am selecting all the fields , if i want to select onlytwo=20 or three tuples,then how to go about it
4. If have idea about java bean = then=20 how to call his function from a Java
Bean.


Thanks=20
Sandeep




------=_NextPart_000_0032_01C20891.36036EF0--