Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions km62/Berenchuk_Olha/laboratory5.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
-- LABORATORY WORK 5
-- BY Berenchuk_Olha
CREATE FUNCTION coun_order(numb_prod integer)
RETURN INT
AS
product_count INT;
begin
select
count(product.prod_id) into product_count
from
Products right join orderitems on
Products.prod_id = orderitems.prod_id
right join orders on
orderitems.Order_num = ORDERS.Order_num
right join customers on
orders.cust_id=customers.cust_id
where distance(product.prod_id);

return numb_prod;
end coun_order;

CREATE procedure count_cust(name_product in products.prod_name, cust_order out orders.cust_id)
is
name_product products.prod_name.%type,
cust_order orders.cust_id.%type
begin
select products.prod_name into name_product
from

exception when NO_data_found then dbms_output.put_line('can not procedure');
end count_cust;

declare
begin exception count_cust(prod_name => name_product, cust_id => cust_order )
end;