Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Prompting a user input help

570228Jun 12 2007 — edited Jun 12 2007
Ok, I am working on my first database and I am trying to create an end-user intput to populate my table. I have created a before insert trigger that should automatically populate two fields.
Here it is:
SQL> CREATE OR REPLACE TRIGGER emp_update
2 BEFORE UPDATE OR INSERT ON emptemp
3 FOR EACH ROW
4 BEGIN
5 :NEW.Annual_Salary:=26*80*:NEW.Hourly_Rate;
6 :NEW.Employee_Code:=SUBSTR(:NEW.Last_Name,1,3)||
7 SUBSTR(:NEW.Employee_SSN,-5);
8 END emp_update;
9 /

Trigger created.

SQL>

I'm not very comfortable writing code yet and I need to create a program that will prompt a user to input the other fields in my table (First_name, Last_Name, SSN, Hourly_Rate etc.) Once They input the data I need my trigger to kick off to fill in the two fields that it references.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2007
Added on Jun 12 2007
11 comments
955 views