Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am doing my work in Oracle. In SQL Developer, create a procedure named TAX_COST_SP using the shoppers state and subtotal values. If the state

I am doing my work in Oracle.

In SQL Developer, create a procedure named TAX_COST_SP using the shoppers state and subtotal values. If the state isnt listed in the table, no tax is added. The state and the subtotal are the inputs to the procedure, and the tax amount should be returned. BB_TAX is table that contains state = VA and taxrate = .45. So far the following is what I have:

CREATE OR REPLACE PROCEDURE TAX_COST_SP (p_state IN VARCHAR2, p_subtot IN NUMBER, p_total_tax OUT NUMBER) IS BEGIN SELECT taxrate * p_subtot INTO p_total_tax FROM BB_TAX WHERE IDSTATE = p_state; END;

When I run the following code I receive an invalid number error:

DECLARE lv_total_tax NUMBER(4,3); BEGIN TAX_COST_SP('VA',100, lv_total_tax); DBMS_OUTPUT.PUT_LINE('Calculated tax is $'|| lv_total_tax); END;

What am I doing wrong?

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

More Books

Students also viewed these Databases questions

Question

4. Evaluation is ongoing and used to improve the system.

Answered: 1 week ago

Question

6. Effectively perform the managers role in career management.

Answered: 1 week ago