Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger Compiles but is invalid 2

Status
Not open for further replies.

stuckDuck

Programmer
Jun 30, 2010
30
CA
My trigger compliles but is invalid. Help appreciated.


For each user_id I want to generate a random pasword.
dbms_random.value is a system package that generates random characters.

**************

create or replace trigger trigger_password_generate
after insert or update of "USER_ID" on application_user
for each row
BEGIN

insert into application_user ("password")
select dbms_random.script('p',8) value from dual;

end;
/

Error Message:
Line 4, Position 21:pLS-00302: component 'SCRIPT' must be declared.

Line 4, Position 9: PL/SQL: ORA-00904: "DBMS_RANDOM"."SCRIPT": invalid identifier

Line 3, Postition 2: PL/SQL: SQL Statement ignored

 
Hi,
Why are you calling select dbms_random.script?

Shouldn't it be:
select dbms_random.string('p',8) from dual;




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 


Also, you should read about triggers in the fine Oracle® Database SQL Reference.

The way you have coded your trigger will generate an "ORA-04091: table name is mutating, trigger/function may not see it." error.
[3eyes]



----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top