How can I grant privilege's for file formats?

Viewed 591

I'm trying to grant privileges for file formats in an automated way, I just need to basic structure in how to do so. Based on the research I've done so far I think it should look like this:

GRANT ALL PRIVILEGES ON myformat IN mydb.myschema TO myrole;

But I'm getting an error. Any help would be appreciated.

Error : "SQL compilation error: syntax error line 1 at position 34 unexpected 'in'."

thanks

2 Answers

You need use the three-part qualifier instead of IN. You also need to specify that it's a file format, otherwise it will complain that it can't find the table with that name.

GRANT ALL PRIVILEGES ON FILE FORMAT mydb.myschema.myformat TO myrole;

You need to use the following syntax

GRANT ALL PRIVILEGES ON FILE FORMAT mydb.myschema.myformat TO myrole;

Related