August S.

asked • 03/02/15

SQL database

 Write a script that creates and calls a stored procedure named spInsertProduct that inserts a row into the Products table. This stored procedure should accept five parameters. One parameter for each of these columns: CategoryID, ProductCode, ProductName, ListPrice, and DiscountPercent. If the value for the ListPrice column is a negative number, the stored procedure should raise an error that indicates that this column doesn’t accept negative numbers. Similarly, the procedure should raise an error if the value for the DiscountPercent column is a negative number. When inserting data into the Products table, set the Description column to an empty string and set the DateAdded column to the current date. Code at least two EXEC statements that test this procedure (one successful, one failure)

1 Expert Answer

By:

Ron E. answered • 04/29/20

Tutor
4.9 (290)

PL/SQL / SQL / Database Design Tutor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.