Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Dirk.

Asked: October 22, 2016 - 7:50 am UTC

Last updated: October 24, 2016 - 12:41 am UTC

Version: Oracle Forms 6i

Viewed 1000+ times

You Asked

Hello,

How can I catch warning ora-28002 (password will expire within days) in Oracle forms 6i?
I tried in several triggers but with no success.

Is there a way to catch such warnings in Forms? Also for example the ora-28001 (expired) code.

We want to popup a window where the user can change his password during the grace period when he logs on.

Thanks.

Dirk C.

and Connor said...

The more recent versions of Forms deal with this automatically.

For 6i... hmmm. I dont have a 6i to test this on, but as a guess:

- write your own login popup window
- override the on-logon trigger with your own custom calls to the LOGIN builtin
- see if you get the error code back from that command. If you do, then you could present the user with an "current / new / repeat new" style of password window.

But yeah...I think you'll have handle it yourself.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Dirk C., October 22, 2016 - 11:25 am UTC

Hi,

Thank you for your answer. I tried several things with the on-logon trigger and the logon built-in. But I can't trap the error code. I see no solution for this. Maybe querying a data dictionary table?

Sadly enough management won't upgrade forms but they are constantly asking new development. And the development team keeps begging for an upgrade but we don't get it.

Best regards,
Dirk
Connor McDonald
October 24, 2016 - 12:41 am UTC

You could perhaps go about this via a very long-winded fashion.

- Form logs in with a known (fixed) username / password with limited privileges
- the user has just enough privs to call a proc which queries DBA_USERS to pick up status, expiry date etc etc
- if appropriate, pop up a customer change password etc dialog
- re-login as the true username/password.

Sounds like hard work :-(

To Dirk

J. Laurindo Chiappa, October 24, 2016 - 12:36 am UTC

Dirk, I will not able to test this right now but if I remember correctly, when Forms 6i receives an error or a warning from the database, they both can be trapped via ON-ERROR / ON-MESSAGE triggers , and inside the code you could ask for it, something like this :

...

IF SQLCODE = 'ORA-28002' (or DBMS_ERROR_CODE = 'ORA-28002') THEN

clear_message;

Message('Your password will expire within 7 days.');

Message('Your password will expire within 7 days.');

END IF;

Another possibility could be the POST-LOGON trigger (not the ON-LOGON) : POST-LOGON fires after the database logon is complete... In that trigger mayv]be you could check the STATUS column in USER_USERS view asking for userĀ“s own status....

Regards,

J. Laurindo Chiappa

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library