-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtry_product_insert.sql
42 lines (34 loc) · 1.27 KB
/
try_product_insert.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
set serveroutput on;
declare
nam product.name%TYPE:='Rx 480';
bran product.brand%TYPE:='AMD';
cat product.catagory%TYPE:='GPU';
pro_code product_info.product_code%TYPE:=1215;
sup_id product_info.sid%TYPE:=4;
buy_price product_info.buyprice%TYPE:=28000;
sell_price product_info.sellprice%TYPE:=35000;
branc product_info.branch%TYPE:='Dhanmondi';
cus_id product_info.cid%TYPE:=2;
res number;
begin
--new product inset
/*
res := product_package.insert_product_new(nam,bran,cat,pro_code,sup_id,buy_price,sell_price,branc);
if res = 1 then
dbms_output.put_line('Product code ' || to_char(pro_code) || ' Product Name ' || to_char(nam) || ' inserted as new product');
ELSIF res = 2 then
dbms_output.put_line('Product code ' || to_char(pro_code) || ' all ready exists');
ELSE
dbms_output.put_line('Problem');
END IF;
*/
res := product_package.insert_product_old(nam,bran,cat,pro_code,cus_id,buy_price,sell_price,branc);
if res = 1 then
dbms_output.put_line('Product code ' || to_char(pro_code) || ' Product Name ' || to_char(nam) || ' inserted as used product');
ELSIF res = 2 then
dbms_output.put_line('Product code ' || to_char(pro_code) || ' all ready exists');
ELSE
dbms_output.put_line('Problem');
END IF;
end;
/