Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

dinamic sql



Hi

I need to write a Postgres function which executes a cursor. Query of this cursor however is created on the basis of parameters passed by user.


if(user_Input = 'a')
l_query := l_query||a_from_clause ||'where ename in '||user_Input
else
if(user_Input = 'b')
l_query := l_query||b_from_clause||'where ename in '||user_Input

OPEN csr FOR l_query;


How do we do it is postgres. My problem I know how to pass parameters like "ename=parameter", but If the SQL sentence is  ename in (parameters). It does not work.

Thanx in Advance.


Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group