Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

DDL in a macro - forum topic by mayya@teradataforum

$
0
0

       I created a macro as below by using log-in "cly_dba",
  replace macro cly_db.zam_emp_mac1
 as
 (
   create table cly_db.zam_dummy
 (
 col1 integer,
 col2 varchar(10)
 );
 );
But when i execute above macro, it is giving me the error written below,
exec   cly_db.zam_emp_mac1 ;
""3524: An owner referenced by user does not have CREATE TABLE WITH GRANT OPTION access to database cly_db"".
I tried granting rights to database "cly_db" to user "cly_dba" as below,
grant all on cly_db to cly_dba with grant option ;
grant create table on cly_db to cly_dba with grant option ;
But still I am getting above error.
And when I create the same table directly in SQL assistant as below, it  is working fine.
 create table cly_db.zam_dummy
 (
 col1 integer,
 col2 varchar(10)
 );

Please let me know why it is giving error when i try to create table through macro.

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles