Create a FUNCTION that will print out an address label for the TAL Distributors database using the Customer table. You can specify the customer table to output the address.
Here is an example of the output expected:
Toys Galore
28 Laketon St.
Fullton, CA 90085
The database name is "TAL Distributors" and images of all the tables have been attached. Please double check that function executes before answering.
Customer Table:
drop table customer cascade constraints;
create table customer(customer_num int primary key,
Customer_name varchar(25),
street
varchar(25),
City
varchar(10),
State
char(2),
ZIp1
varchar2(25),
Balance
number(10,2),
Credit_limit number(10,2),
Rep_num
int);
insert into customer values(00001,'Jones Jim','811 Montervideo
Dr','Lansing','MI','48823',1000.00,10000.00,1);
insert into customer values(00002,'Richardson Jamila','4216 W Outer
Drive','Detriot','MI','48204',500.00,50000.00,2);
set serveroutput on;
CREATE or replace function MYfunction6 return varchar2
as
output varchar2(200);
CURSOR C1 IS
SELECT Customer_name,Street,City,State,Zip1
FROM CUSTOMER;
begin
for p in c1
loop
output := output || ' ( '
||p.Customer_name|| ' ' ||p.Street|| ' '||p.City ||' '||P.state||'
'||p.Zip1||')';
END LOOP;
return output;
end;
/
select MYfunction6 from dual;
Create a FUNCTION that will print out an address label for the TAL Distributors database using the Customer table. You c...