Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following code will concatenate two strings str1 and str2 CREATE OR REPLACE PROCEDURE concatenate_strings as str1 VARCHAR2(25) := 'begin'; str2 VARCHAR2(25) := 'end'; result

The following code will concatenate two strings str1 and str2

CREATE OR REPLACE PROCEDURE concatenate_strings as

str1 VARCHAR2(25) := \'begin\';

str2 VARCHAR2(25) := \'end\';

result VARCHAR2(50); BEGIN result := str1 || \'_\' || str2; dbms_output.put_line(\'The result is \' || result); dbms_output.put_line(SYSDATE);

END; /

SET SERVEROUTPUT ON;

EXECUTE concatenate_strings;

Modify this procedure to accept two string parameters.

Example of the output for EXECUTE concatenate_strings(\'big\',\'dog\');

The result is big_dog 26-Jan-16

Write a function f_concatenate_strings that will do the same as concatenate_strings procedure from #1, but can be called from a select statement.

Examples of output: SELECT f_concatenate_strings(\'big\',\'dog\') FROM DUAL;

Will return big_dog 27-JAN-16

SELECT f_concatenate_strings(ProductName, to_char(ListPrice, \'$999.99\')) from ProductTable WHERE ProductID=302;

First, the table ProductTable, then product with ID 302 will be located. Product name of that product will be concatenated with the price and current date.

Will return Wind-Up Water Swimmers_ $2.00 27-JAN-16

Create a procedure that accepts product ID as a parameter and returns the price from ProductTable table. Add exception handling to catch if product ID is not in the table. The table ProductTable already exists (see sample code in this module).

Needs to be completed in SQL Developer and please provide 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_2

Step: 3

blur-text-image_3

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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

Show that d/dx 4 1 + tanh x/1- tanh x = 1/2e x/2 .

Answered: 1 week ago