Macro - SELECT WITH GRANT OPTION access error

Database

Macro - SELECT WITH GRANT OPTION access error

Hi

I created a macro for delete and insert records to a table from a view on another DB.

REPLACE MACRO DB1.macro_ins as (
delete from DB2.tab1 all;
insert into DB1.tab1
select col1,col2 from DB3.viewA;
);

when executing the macro 

exec  DB1.macro_ins

I am getting access issue in the table DB3.tabA

 Failed. 5315: An owner referenced by user does not have SELECT WITH GRANT OPTION access to DB3.tabA. But I can run the query individually without any permission issue.

Could someone help me out ?

Thanks

Jimmy

1 REPLY
Senior Apprentice

Re: Macro - SELECT WITH GRANT OPTION access error

Hi Jimmy,

you need to grant those rights including GRANT OPTION to the database DB1.