Dear All,
I have a simple table
CREATE TABLE table1{
user name,
si numeric
};
Also I have function:
CREATE FUNCTION check1(numeric) RETURN text AS'
DECLARE
SI ALIAS AS $1;
username name;
BEGIN
username:=(SELECT user FROM table1 WHERE si=SI)
SET SESSION AUTHORIZATION username;
RETURN username;
END;
'LANGUAGE 'plpgsql';
However, when I call the function I get the error:
ERROR: syntax error at or near "$1" at character 28
CONTEXT: PL/pgSQL function "check1" line11 at SQL statement
If I comment out the "SET SESSION ..." the function works, i.e. it outputs a
valid username. I create and execute the function as a superuser.
Any suggestions?
Many thanks
Colin
_________________________________________________________________
Hotmail messages direct to your mobile phone http://www.msn.co.uk/msnmobile