Consultor Eletrônico



Kbase P21021: How to create a Script that will grant SELECT on all tables in a Database
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   05/11/2008
Status: Verified

GOAL:

How to create a Script that will grant SELECT on all tables in a Database

GOAL:

How to grant Select on all tables within a database.

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

1. Connect to the database with a 4GL client.

2. Run the following program from the Progress 4GL session, it will create a file named allfiles.SQL:

OUTPUT TO c:\temp\allfiles.SQL.
FOR EACH _file WHERE _file._file-num GT 0 AND _file._file-num LT 32000 NO-LOCK:
PUT UNFORMATTED 'grant select on pub."' + _file._file-name + '" to public ~;'
SKIP.
PUT UNFORMATTED 'COMMIT;'
SKIP.
END.

3. Execute the file allfiles.SQL file from SQL Explorer in batch mode as follows:
sqlexp -char -infile allfiles.SQL -outfile report.txt -db -S -H -user -password < password>