Ask the Expert

Syntax for username commands in Forms 6i

I need to issue the "alter user username account unlock" and "alter user username password expire" commands inside Forms 6i. What is the correct syntax? I tried using
Forms_DDL ('Begin alter user '||:users.login_name||' 
account unlock  ;End;');

IF Form_Success THEN
Message (' User '||:users.login_name|| 
' account is unlocked.');
END IF;

Forms_DDL ('Begin alter user '||:users.login_name||' 
password expire ;End;');
IF Form_Success THEN
Message (' User '||:users.login_name|| 
' account is set to expire.');
END IF;

    Requires Free Membership to View

The problem with your syntax is that the "ALTER" command is not a PL/SQL command. By using "Begin" and "End" you are creating a PL/SQL. Remove "Begin" and "End" from your syntax. See below. Also the user must have "Alter User" system privileges to alter a user.
forms_ddl('alter user '||user|| ' account lock ');

forms_ddl('ALTER USER '||:user.login_name||' 
IDENTIFIED BY '||:user.login_name||' PASSWORD EXPIRE';

This was first published in July 2006

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: