Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id E3C6A475F43 for ; Tue, 28 May 2002 05:15:45 -0400 (EDT) Received: from vreach.net (unknown [203.200.123.22]) by postgresql.org (Postfix) with ESMTP id 73DF8475AF2 for ; Tue, 28 May 2002 05:14:02 -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 ; Tue, 28 May 2002 14:42:58 +0530 Message-ID: <00bc01c20627$96dad450$1302a8c2@multicast.com> From: "Sandeep Chibber" To: Subject: Problem with the result set of postgres Date: Tue, 28 May 2002 14:41:02 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00B9_01C20655.B06CEAB0" X-Priority: 3 X-MSMail-Priority: Normal 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/5 X-Sequence-Number: 7970 This is a multi-part message in MIME format. ------=_NextPart_000_00B9_01C20655.B06CEAB0 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 parameter from my application and on the basis of the parameter retreive a result set. You have helped me in getting the result set but if want to pass a parameter in the WHERE Claues ,i have no idea. Table structure is CREATE TABLE ICDN_EVENTREG ( USER_ID VARCHAR(30) NOT NULL , PASSWORD VARCHAR(16) , EMAIL VARCHAR(80) , DEPARTMENT VARCHAR(30) , FIRST_NAME VARCHAR(30) , LAST_NAME VARCHAR(30) , DESIGNATION VARCHAR(30) , TYPE VARCHAR(15) , STATUS VARCHAR(15) DEFAULT 'Pending',DOJ TIMESTAMP) ; 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,stat us 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 for your prompt reply. You are saving me from lot of trouble. Thanks again Sandeep ------=_NextPart_000_00B9_01C20655.B06CEAB0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
Hi ,

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

You have helped me = in=20 getting the result set but if want to pass a parameter
in the WHERE Clau= es ,i=20 have no idea.

Table structure is

CREATE TABLE ICDN_EVENTREG&n= bsp;=20 (  USER_ID VARCHAR(30) NOT NULL ,   PASSWORD
VARCHAR(16)= =20 ,   EMAIL VARCHAR(80) ,  DEPARTMENT VARCHAR(30) ,  = ;=20 FIRST_NAME
VARCHAR(30) ,  LAST_NAME VARCHAR(30) ,   = =20 DESIGNATION VARCHAR(30) ,  TYPE
VARCHAR(15) ,  STATUS VARCHAR(= 15)=20 DEFAULT 'Pending',DOJ TIMESTAMP) ;


Function body is as=20 bellow

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

I want to Kno= w=20 how
1. How to pass parameter to this function
2. How to call this=20 application
3. In this function i am selecting all the fields , if i wan= t to=20 select only
two or three tuples,then how to go about it
4. If have id= ea=20 about java bean then how to call his function from a Java
Bean.

T= hanks=20 for your prompt reply. You are saving me from lot of trouble.

Thanks= =20 again

Sandeep




------=_NextPart_000_00B9_01C20655.B06CEAB0--