Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing user password from Oracle Forms.

745 views
Skip to first unread message

amir_raza_khan

unread,
Jul 1, 1997, 3:00:00 AM7/1/97
to

Is there any body on this planet to HELLLLLLLLP me.

Here is my problem.

I am working in D2K, while using Oralce Forms 4.5 I have retrived the user
password with GET_APPLICATION_PROPERTY but I am unable to change it.
SET_APPLICATION_PROPERTY can not set the password of the user and
'ALTER USER ...' command can not be used because it gives following error at
compile time.
Encountered the symbol 'ALTER' which is an unsupported reserved word.

I will be very gratful if any body can answer. THANKS.


Amir Raza Khan (SE)
Lahore Stock Exchange

ark...@genius.brain.net.pk
se...@brain.net.pk

Steve Johnson

unread,
Jul 2, 1997, 3:00:00 AM7/2/97
to

Try
forms_ddl('ALTER USER user IDENTIFIED BY password');
This should work.

Steve

R. Fingerson

unread,
Jul 2, 1997, 3:00:00 AM7/2/97
to

Amir, Raza, Khan wrote:
>
> Is there any body on this planet to HELLLLLLLLP me.
>
> Here is my problem.
>
> I am working in D2K, while using Oralce Forms 4.5 I have retrived the user
> password with GET_APPLICATION_PROPERTY but I am unable to change it.
> SET_APPLICATION_PROPERTY can not set the password of the user and
> 'ALTER USER ...' command can not be used because it gives following error at
> compile time.

You should be able to use the dbms_sql package to do this, and
build the 'alter user' statement as a character string.

Robin
--
pho...@frii.com
http://www.frii.com/~phouka/
Reality is that which, when you stop believing in it, doesn't go away

Frank Brammer

unread,
Jul 2, 1997, 3:00:00 AM7/2/97
to

The alter user command is the way to go. Try it in a stored procedure.
Make sure the User that Creates the Package has the ALTER USER/SESSION
privilege.

Frank Brammer
Practical Software Solutions

Deb Ghosh

unread,
Jul 3, 1997, 3:00:00 AM7/3/97
to

One option would be to use FORMS_DDL Built-in package and pass the ALTER
... statement to the database.

Deb.


Amir, Raza, Khan wrote:
>
> Is there any body on this planet to HELLLLLLLLP me.
>
> Here is my problem.
>
> I am working in D2K, while using Oralce Forms 4.5 I have retrived the user
> password with GET_APPLICATION_PROPERTY but I am unable to change it.
> SET_APPLICATION_PROPERTY can not set the password of the user and
> 'ALTER USER ...' command can not be used because it gives following error at
> compile time.

william

unread,
Jul 8, 1997, 3:00:00 AM7/8/97
to

I have a bulletin from Oracle that explains how to change a user's
password. It does it through a form but the following syntax may resolve
your problem.

The password change is achieved by issuing a forms_ddl command:

FORMS_DDL('ALTER user '|| UN || ' IDENTIFIED BY ' || PW);

Hope this helps.

Kathie

Amir Raza Khan wrote in article <5pb319$k...@drn.zippo.com>...

Jonathan Ingram

unread,
Jul 9, 1997, 3:00:00 AM7/9/97
to

On Wed, 02 Jul 1997 10:35:28 -0600, "R. Fingerson"
<rfi...@netmail.mnet.uswest.com> wrote:

>Amir, Raza, Khan wrote:
>>
>> Is there any body on this planet to HELLLLLLLLP me.
>>
>> Here is my problem.
>>
>> I am working in D2K, while using Oralce Forms 4.5 I have retrived the user
>> password with GET_APPLICATION_PROPERTY but I am unable to change it.
>> SET_APPLICATION_PROPERTY can not set the password of the user and
>> 'ALTER USER ...' command can not be used because it gives following error at
>> compile time.
>

>You should be able to use the dbms_sql package to do this, and
>build the 'alter user' statement as a character string.

You can certainly do this. Included below is a routine that does so. I
hope you find it useful.

CREATE OR REPLACE
FUNCTION Change_Password (vUsername IN varchar2,
vPassword IN varchar2)

RETURN integer

IS

iCursorID integer;
vCommand varchar2 (80);
iReturned integer;

xMISSING_PARAMETER EXCEPTION;

BEGIN
IF (vUserName IS NULL OR vPassword IS NULL) THEN
RAISE xMISSING_PARAMETER;
END IF;

vCommand := 'ALTER USER ' ||
vUsername ||
'identified by ' ||
vPassword;

iCursorID := DBMS_SQL.Open_Cursor;
DBMS_SQL.Parse (iCursorID,
vCommand,
DBMS_SQL.v7);

iReturned := DBMS_SQL.Execute (iCursorID);
DBMS_SQL.Close_Cursor (iCursorID);

RETURN 1;

EXCEPTION
WHEN OTHERS THEN
RETURN 0;
END Change_Password;
/

Please not that it does NOT verify that the current user is changing
only his password, but if you call it from a menu item or button on a
form you can certainly perform that validation there.

By compiling this function as a DBA, you can verify that the function
will be able to alter the user's password without granting alter user
to all of your users.

This is one of the routines included on the CD for my new book, High
Performance Oracle Database Automation (published by The Coriolis
Group), which should be hitting the shelves soon.

Jonathan Ingram


0 new messages