Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create function problem

Status
Not open for further replies.

plork123

Programmer
Mar 8, 2004
121
GB
hi all,

can someone please help me out with a function - returning a rs with an inner join

it works when not in a function but when i try to put it in a function it errors

CREATE OR REPLACE FUNCTION fn_my_function (int8, "varchar")
RETURNS SETOF table3 AS

'SELECT
t1.id, t2.userid, code
FROM
table1 t1 INNER JOIN table2 t2 e ON t1.userid = t2.userid,
table3 t3
WHERE
t1.userid = $1
AND code ~* $2
- AND t3.id = t1.id'

LANGUAGE 'sql' VOLATILE;

thanks for any help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top