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
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