Print Thread
Create User and Grant Priv in Single Query
#1625 02/03/01 02:55 AM
Joined: Jul 2000
Posts: 12
Atlanta, GA USA
D
d4jaj1 Offline OP
Member
OP Offline
Member
D
Joined: Jul 2000
Posts: 12
Atlanta, GA USA
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?


----------
Jay
Re: Create User and Grant Priv in Single Query
#1626 02/03/01 06:24 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
In Oracle8i you can execute the following PL/SQL Block:
[quote]
Code
begin
  execute immediate 'CREATE USER TEST IDENTIFIED BY FTP DEFAULT TABLESPACE USR';
  execute immediate 'GRANT CONNECT TO TEST';
end;
[/quote]
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


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.101s Queries: 12 (0.064s) Memory: 2.4993 MB (Peak: 3.0430 MB) Data Comp: Off Server Time: 2024-05-20 08:17:03 UTC
Valid HTML 5 and Valid CSS