Create User and Grant Priv in Single Query

d4jaj1

Member²
Hello,

Using Oracle SQL Worksheet, I can perform this code as a single transaction:

CREATE USER "TEST"
IDENTIFIED BY "FTP"
DEFAULT TABLESPACE "USR";
GRANT "CONNECT" TO "MEEE"

When I attempt to use this in a DOA 3.4.3 TOracleQuery, I get an invalid character due to the semi-colon. How do I accomplish this with an OracleQuery component and without having to issue 2 separete queries?
 
In Oracle8i you can execute the following PL/SQL Block:
Code:
begin
  execute immediate 'CREATE USER TEST IDENTIFIED BY FTP DEFAULT TABLESPACE USR';
  execute immediate 'GRANT CONNECT TO TEST';
end;
For Oracle8.0 or Oracle7 you can do something similar with the dbms_sql package. Note that you can also use the TOracleScript command to execute multiple SQL statements.

------------------
Marco Kalter
Allround Automations
 
Back
Top