Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

CREATE USER in Forms 10G PL/SQL

499240Mar 17 2006 — edited Apr 20 2006
Hello,
I'm starting to learn how to use Forms, in Oracle 10g. I am attempting to do a CREATE USER statement in PL/SQL, with no luck.

What I have is a Form with a Data Block. There are two items in that block, from a table in the database. Also in the Data Block is a button. This button has one trigger: WHEN-BUTTON-PRESSED.
In the PL/SQL for this trigger, I want a 'CREATE USER <blah> IDENTIFIED BY <blah>' SQL statement.
ALL_USERS is the name of my Data Block.
USERNAME is the name of an item in the Data Block.

My attempts so far:
'CREATE USER :ALL_USERS.USERNAME IDENTIFIED BY :ALL_USERS.USERNAME';
both with and without the single quotes doesn't work, and adding
BEGIN

END
around the statement doesn't work.

I tried a couple of other ways suggested online:

EXECUTE IMMEDIATE 'CREATE USER :ALL_USERS.USERNAME IDENTIFIED BY :ALL_USERS.USERNAME';
but get the error message 'This feature is not supported in client-side programs'

I've also tried

DECLARE

cur integer;

BEGIN

cur := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(cur, 'CREATE USER jim IDENTIFIED BY jim', DBMS_SQL.NATIVE);
DBMS_SQL.CLOSE_CURSOR(cur);

END;

This time, I got a 'Implementation Restriction: 'DBMS_SQL.NATIVE' cannot access remote package variable or cursor


Is it possible to do this kind of statement in PL/SQL? If so, can anyone out there tell me how? Any assistance would be greatly appreciated.

Regards,
James.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2006
Added on Mar 17 2006
2 comments
520 views