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 last published in July 2006

Dig Deeper on Using Oracle PL-SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

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.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close