Q

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 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;
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

Dig deeper on Using Oracle PL-SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

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:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close