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

  1. Connect to the database with the OpenEdge client.
    $   prowin32 dbname [-S <portnumber> -H <hostname>]
  2. Run the following program from the OpenEdge session to create a file named ReadWrite.sql in 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.
    
  3. Execute the file ReadWrite.SQL file 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>