Read and write privileges
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
If you have database administrator privileges, you can access, modify, or delete a database object and also grant privileges to other users. If you have resource privileges, you can create database objects.
The following procedure generates a SQL script file to grant READ WRITE
privileges on all the database tables for a specific user:
- Connect to the OpenEdge database and run the ABL code mentioned to generate the SQL script.
- Now execute the SQL script to grant READ WRITE privileges on all
the database tables. Note: The resulting SQL script files may be executed using any JDBC client like the OpenEdge SQL Explorer Tool.
Steps
- Connect to the database with the OpenEdge
client.
$ prowin32 dbname [-S <portnumber> -H <hostname>] - Run the following program from the OpenEdge session to create a file
named
ReadWrite.sqlin the current working directory:OUTPUT TO .\ReadWrite.SQL. FOR EACH _file WHERE _file._file-num GT 0 AND _file._file-num LT 32000 NO-LOCK: PUT UNFORMATTED 'grant select, update, insert,delete on PUB."' + _file._file-name + '" to username ~;' SKIP. PUT UNFORMATTED 'COMMIT;' SKIP. END. - Execute the file
ReadWrite.SQLfile from SQL Explorer in batch mode as follows, to grant the privileges to the user:$ sqlexp -char -infile ReadWrite.SQL -outfile report.txt -db -S -H -user <SQL_Admin_User> -password < password>