Hi Carlos,

I didn't read the rest of your proc, but one thing jumped out at me right away.

Instead of:

      GRANT ALL ON :TBLNAME TO :USRGRP;


Try to use an execute statement. Like: execute('GRANT ALL ON FOO TO BAR');

Of course, you'll need to format that correctly for whatever you're doing. GRANT is not allowed in the body of a stored procedure.

Cheers,
JLS


Carlos Yabut wrote:

Hi I am having problems with the dbproc below

CREATE DBPROC DBA.EMAYA_SET_ALLGRPPRV
(
IN USRGRP VARCHAR(32)
)
AS
VAR TBLNAME VARCHAR(100);
TRY
DECLARE L_C1 CURSOR FOR
SELECT TABLENAME FROM DOMAIN.TABLES WHERE
TYPE='TABLE';
FETCH FIRST L_C1 INTO :TBLNAME;
WHILE ($RC <> 100) DO
BEGIN
GRANT ALL ON :TBLNAME TO :USRGRP;
FETCH NEXT L_C1 INTO :TBLNAME;
END;
CLOSE L_C1;
CATCH
IF $RC <> 0 THEN STOP ($RC, 'Can not add the
new position');


The grant statement is not recognized as a Reserved
word and is giving me the following error

Syntax error or access violation;-5015 POS(302)
Missing
keyword:WHILE,SELECT,IF,EXECUTE,SET,RETURN,FETCH,CONTINUE,CLO.

Anyhelp is appreciated.

Thanks

charlie





__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer





-- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to