Redian新闻
>
how to include record deleted date into trigger?
avatar
how to include record deleted date into trigger?# Database - 数据库
h*r
1
Professor's requirements: Create a database trigger that stores deleted
customer records in an archive table. The archive table should also include
the DATE the customer record was deleted from the customer table.
I know how to create the trigger,but don't know how to include the date the
customer record was deleted. Anyone can give me some hlep? Thanks
BEFORE DELETE ON borrower_t
FOR EACH ROW
BEGIN
INSERT INTO borrowerarchive
VALUES(:Old.borrower_ssn, :Old.Borrower_Firstname, :Old.Borrower_Last
avatar
b*e
2
why don't you just create a column in the archive table that has
default set to sysdate?

【在 h****r 的大作中提到】
: Professor's requirements: Create a database trigger that stores deleted
: customer records in an archive table. The archive table should also include
: the DATE the customer record was deleted from the customer table.
: I know how to create the trigger,but don't know how to include the date the
: customer record was deleted. Anyone can give me some hlep? Thanks
: BEFORE DELETE ON borrower_t
: FOR EACH ROW
: BEGIN
: INSERT INTO borrowerarchive
: VALUES(:Old.borrower_ssn, :Old.Borrower_Firstname, :Old.Borrower_Last

avatar
h*r
3
could you give me a simple sample of how to do that. sorry newer to oracle.
thanks

include
the

【在 b****e 的大作中提到】
: why don't you just create a column in the archive table that has
: default set to sysdate?

avatar
b*e
4
alter table borrowerarchive add (delete_date date default sysdate)

【在 h****r 的大作中提到】
: could you give me a simple sample of how to do that. sorry newer to oracle.
: thanks
:
: include
: the

avatar
h*r
5
Thanks a lot

oracle.

【在 b****e 的大作中提到】
: alter table borrowerarchive add (delete_date date default sysdate)
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。