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 = '||user_Input
else
if(user_Input = 'b')
l_query := l_query||b_from _clause||'where ename = '||user_Input
OPEN csr FOR l_query;
How do we do it is postgres
Thanx in Advance.
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 = '||user_Input
else
if(user_Input = 'b')
l_query := l_query||b_from _clause||'where ename = '||user_Input
OPEN csr FOR l_query;
How do we do it is postgres
Thanx in Advance.