Subject stored procedure to GRANT priveledges not working
Author robertgilland
I have written this stored proc.

SET TERM #;
CREATE PROCEDURE PROC_ADDUSER
( USERORROLE CHAR(31)) AS
DECLARE VARIABLE THERELNAME CHAR(80);

BEGIN
FOR SELECT RDB$RELATION_NAME FROM RDB$RELATIONS
WHERE RDB$RELATION_NAME NOT LIKE 'RDB$%'
ORDER BY RDB$RELATION_NAME INTO :THERELNAME
DO
BEGIN
GRANT ALL ON :THERELNAME TO :USERORROLE;
END
END#
SET TERM ;

When I run in IBOConsole I get:

ISC ERROR CODE:335544569

ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -104
Token unknown - line 10, column 6
GRANT


What is wrong with this?

Reegards,

Robert