grant select permissions on created table

Hi:

 I have created a table as follows:

libname A db2 database=D SCHEMA=B user=&userid password=&userpw;

proc sql;
create table A.MTH(BULKLOAD=YES,DBCOMMIT=1000000,INSERTBUFF=10,
BL_DATAFILE='/myfolder/test.dat',BL_OPTIONS='compound=7 norowwarnings')
as select *
 from X.T1;
grant select on A.MNTH  to user1,user2  <------want to accomplish this!!
quit;
LuckyLucksAsked:
Who is Participating?
 
bradanelsonConnect With a Mentor Commented:
You have to send that command to the database.  SAS will not process this command, obviously, that is why you are here. :-)

Here is some code I have used to connect to a database and send the GRANT command.

PROC SQL;
    CONNECT TO DB2(USER="&Username" PASS="&Password" PATH="&Pathname");

    EXECUTE(GRANT SELECT ON A.MNTH TO user1,user2) BY DB2;

    DISCONNECT FROM DB2;
QUIT;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.