ORACLE-TRIGGERS

30 pts.
Tags:
Oracle PL/SQL
Oracle SQL Developer
Oracle triggers
SQL Trigger
Hello, im going to create a trigger(insert or update) for a tableA, when it fires inserted or updated columns are should be insert or update into another table say tableB, one column(Processed_time) in tableB where its value will be by subtrcting two columns in tableA(response_time,Submission_time) all are timestamp type how to update(Processed_time) in tableB by subtracting above two clmns in tableA --------------------------------------------------------------------------------

Software/Hardware used:
SOFTWARE-ORACLE 10G

Answer Wiki

Thanks. We'll let you know when a new response is added.

Working with Oracle TIMESTAMP data type is so much easier than Oracle’s DATE data type (which of course) included date & time.

TIMESTAMP is more granular (detailed). Oracle’s TIMESTAMP includes micro seconds (6 digits to the right of the decimal point) , exactly like DB2′s TIMESTAMP.

For TIMESTAMPs in Oracle simply substract one from the other.

SELECT ts1 , ts2 , ts2 – ts1
FROM …

The result of such an operation is NOT a TIMESTAMP. It is a DURATION in the format of
number of days followed by number of hours and minutes and seconds and microseconds.
A subtle distinction – but let me use an example of subtracting June 28 from June 30. The answer is 2 days. The answer is NOT January 2.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
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
  • RizwanSharief
    [...] If you need help creating Oracle triggers like RizwanSharief did, Meandyou provided an answer that’s been [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
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

Thanks! We'll email you when relevant content is added and updated.

Following