Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

have 4 errors i am getting on my sequences and my triggers: /*create trigger*/ /*Display when new housing item is added*/ CREATE TRIGGER housing_Trigger AFTER

have 4 errors i am getting on my sequences and my triggers:

/*create trigger*/

/*Display when new housing item is added*/

CREATE TRIGGER housing_Trigger AFTER INSERT ON Housing FOR EACH ROW BEGIN dbms_output.put_line ('A housing item has been added!!'); END;

/*Send email to alert an new spender has been added*/

CREATE TRIGGER new_spender BEFORE INSERT ON spender FOR EACH ROW BEGIN CALL sendmail ('Spender Added') INSERT INTO logtable VALUES ('Spender_id', "firstname". "lastname", "address", "location"); END;

/* Create sequence*/

CREATE SEQUENCE Spender_seq START WITH 1 INCREMENT BY 1; CREATE SEQUENCE Spender1_seq START WITH 0 INCREMENT BY -1;

Error: near line 104: near "dbms_output": syntax error Error: near line 112: near "CALL": syntax error Error: near line 310: near "SEQUENCE": syntax error Error: near line 314: near "SEQUENCE": syntax error

Reference tables:

Create table spender ( Spender_id integer not null, FirstName varchar (30), LastName varchar (30), Address varchar (30), Location varchar (100), Constraint pk_spender_id primary key (spender_id) );

Create table housing ( housing_item varchar (30) not null, Cost varchar (1000), Time varchar (100), Location varchar (100), Quantity integer, Spendernam integer not null, Constraint pk_housing_item primary key (housing_item), Constraint fk_spendernam foreign key (spendernam) references spender (spender_id) );

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions

Question

send employees to any university program for training?

Answered: 1 week ago