Question
My Part of ERD: Requirement: My procedure: CREATE PROCEDURE ADD_EXTRAS @EXTRA_ID CHAR(10), @EXTRA_CODE CHAR(3), @DESCRIPTION VARCHAR(30), @COST DECIMAL(5,2), @UNIT CHAR(8), @QTY INT, @EXTRA_TOTAL DECIMAL(5,2), @CONTRACT_NUM
My Part of ERD:
Requirement:
My procedure:
CREATE PROCEDURE ADD_EXTRAS
@EXTRA_ID CHAR(10),
@EXTRA_CODE CHAR(3),
@DESCRIPTION VARCHAR(30),
@COST DECIMAL(5,2),
@UNIT CHAR(8),
@QTY INT,
@EXTRA_TOTAL DECIMAL(5,2),
@CONTRACT_NUM CHAR(10)
AS
INSERT INTO EXTRA(EXTRA_ID,EXTRA_CODE,DESCRIPTION,COST,UNIT,QTY,EXTRA_TOTAL,CONTRACT_NUM)
VALUES(
@EXTRA_ID,
@EXTRA_CODE,
@DESCRIPTION,
@COST,
@UNIT,
@QTY,
@EXTRA_TOTAL,
@CONTRACT_NUM);
INSERT INTO ExtrasLog(CustomerID,CustomerFirstName,CustomerLastName,CustomerCity,CustomerState,Contract_NUM,VehicleMake,VehicleModel,VehicleOutDate,TotalCostOfExtras)
VALUES(
(SELECT LICENSE_NUM FROM CONTRACT WHERE @CONTRACT_NUM = CONTRACT.CONTRACT_NUM),
(SELECT F_NAME FROM CUSTOMER),
(SELECT L_NAME FROM CUSTOMER),
(SELECT CITY FROM CUSTOMER),
(SELECT STATE FROM CUSTOMER),
@CONTRACT_NUM,
(SELECT MAKE FROM VEHICLES),
(SELECT model FROM VEHICLES),
(SELECT OUT_DAY FROM CONTRACT),
@EXTRA_TOTAL);
The values part in ExtraLog is not right and I can not find what is wrong at this point. Can anyone help me?
Customer FName City Insurance els Rental Vehicles Type ConditioniD ExtralD Servicel Servicesource ConfracfNumStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started