From: | "Sandeep Chibber" <sandeep(at)vreach(dot)net> |
---|---|
To: | <pgsql-sql(at)postgresql(dot)org> |
Subject: | Problem with the result set of postgres |
Date: | 2002-05-28 09:11:02 |
Message-ID: | 00bc01c20627$96dad450$1302a8c2@multicast.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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 = $1 AND
ICDN_EVENTREG.PASSWORD = $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
From | Date | Subject | |
---|---|---|---|
Next Message | Jan Wieck | 2002-05-28 14:35:11 | Re: Triggers and System Tables. |
Previous Message | schaefer | 2002-05-28 07:40:48 | Re: Some additional PostgreSQL questions |