VERY URGENT

From: "psrao" <psrao(at)comsoft(dot)co(dot)in>
To: "post gressal" <pgsql-hackers(at)postgresql(dot)org>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: VERY URGENT
Date: 2004-12-20 12:22:41
Message-ID: 002001c4e68e$a5a49df0$6d0a96be@PSRAO
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Respected Sir

This is srinvas.

I have been working with Postgresql and have created tables,constraints and so on.

Now i am writing stored functions using refcursor and the stored function have created successfully. But i have problem to validate the parameters passed in the call function..

The query in function returns all the rows with the following statement.

open refcursor for 'select statement'; // without parameters validation

Now i want to validate the parameters and add those validations to the above select query to restrict the output when the parameter is not null.

Example:

if parameter1 is not null then
sqlstring := sqlstring || ' where num=1';
else
sqlstring:= ' ';
end if

open refcursor for ' select statement ' || sqlstring; // Query should be .... select * from table_name where num=1;

When i used the above statements and execute the function it's not returning the data even the parameter validation is true(num=1 is existing).

Please help on above issues and also let me know how to diplay string values (sqlstring).

Example :-(in oracle)

dbms_output.put_line(sqlstring);

I would be very greatful if you could accelerate your reply.

Thank you

Best Regards

Srinivas

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Hallgren 2004-12-20 12:59:07 Re: Permissions within a function
Previous Message Gaetano Mendola 2004-12-20 10:45:52 Re: Stable functions problem