Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is what I am looking at (from MySQL Workbench): https://imgur.com/a/JDp90 CREATE OR REPLACE PROCEDURE CH08_PRC_CUST_ADD (W_CN IN NUMBER, W_CLN IN VARCHAR, W_CFN IN VARCHAR,

This is what I am looking at (from MySQL Workbench): https://imgur.com/a/JDp90

CREATE OR REPLACE PROCEDURE CH08_PRC_CUST_ADD (W_CN IN NUMBER, W_CLN IN VARCHAR, W_CFN IN VARCHAR, W_CBAL IN NUMBER) AS BEGIN INSERT INTO CH08_CUSTOMER (CUST_NUM, CUST_LNAME, CUST_FNAME, CUST_BALANCE) VALUES (W_CN, W_CLN, W_CFN, W_CBAL) END;

EXEC PRC_CUST_ADD (1002,'Rauthor','Peter',0.00); SELECT * FROM CUSTOMER;

CREATE TRIGGER CH08_TRG_UPDATECUSTBALANCE2 AFTER DELETE ON INVOICE FOR EACH ROW BEGIN UPDATE CH08_CUSTOMER SET CUST_BALANCE = CUST_BALANCE - OLD.INV_AMOUNT WHERE CUST_NUM = OLD.CUST_NUM END;

I am trying to create a procedure and a trigger, but am getting syntax errors.

Line 2 says "PROCEDURE" is not valid input

Line 10 says "EXEC" is not valid input

Line 20 says there is a missing semicolon.

What are the syntax errors? Please show the correct code.

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago