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

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.