Subject | stored procedure to GRANT priveledges not working |
---|---|
Author | robertgilland |
Post date | 2006-06-15T01:07:33Z |
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
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