Question : Missing Expression at sql statement

i try to understand the reason of the error 'missing expression' occur in line

([num_size6] + [num_size8] + [num_size10] + [num_size12] + [num_size14] + [num_size16] + [num_size18] + [num_size20] + [num_size22] + [num_size24]) as totalsku

pointing at first (
Code Snippet:
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:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
Purchase Order Report

  DECLARE
 
    vc_period                                           NUMBER;
    vc_master_po_no                                    VARCHAR2(100);
    
    vc_supplier                                    VARCHAR2(100);
    vc_style_code                   VARCHAR2(100);  
    vc_cap                                            VARCHAR2(100);
    vc_master_po_no                            VARCHAR2(100);
    num_size6                                        NUMBER;
    num_size8                                        NUMBER;
    num_size10                                    NUMBER;
    num_size12                                    NUMBER;
    num_size14                                    NUMBER;
    num_size16                                    NUMBER;
    num_size18                                    NUMBER;
    num_size20                                    NUMBER;
    num_size22                                    NUMBER;
    num_size24                                    NUMBER;
    num_requested_qty                        NUMBER;
    vc_cargo_receive_milestone    VARCHAR2(100);
    vc_cargo_receive_actual            VARCHAR2(100);
    
    num_period                                    NUMBER;
    vc_division                                    VARCHAR2(50);
    vc_brand                                        VARCHAR2(50);
    vc_product_type                            VARCHAR2(50);
    vc_modetype                                    VARCHAR2(50);
    vc_vesselname                                VARCHAR2(50);
    vc_port_of_origin                        VARCHAR2(50);
    
    
BEGIN
 
        Select period, division, brand, product_type, modetype, vesselname, port_of_origin, supplier, stylecode, cap, master_po_no, size6, size8, size10, size12, size14, size16,
        size18, size20, size22, size24, requested_qty, cargo_receive_milestone, cargo_receive_actual
        into vc_supplier, vc_style_code, vc_cap, vc_master_po_no, num_size6, num_size8, num_size10,
        num_size12, num_size14, num_size16, num_size18, num_size20, num_size22, num_size24, ([num_size6] + [num_size8] + [num_size10] + [num_size12] + [num_size14] + [num_size16] + [num_size18] + [num_size20] + [num_size22] + [num_size24]) as totalsku ,num_requested_qty,
        vc_cargo_receive_milestone, vc_cargo_receive_actual from vital_dashboard_mv 
        WHERE period = 1; 
        
END;
 
htp.p('');
 
htp.p('');
htp.p('');
htp.p('');
htp.p('');
 
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
 
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
htp.p('');
 
 
 
Actual
SupplierStyle No.CapPO No.681012/XS14/S16/M18/L20/XL2224TotalRemark (Authorisation No.)Qty bookedIntended Cargo Delivery DateCargo Receiving DateCancellations Date / Comments
'|| supplier ||''|| stylecode ||''|| cap ||''|| master_po_no ||''|| size6 ||''|| size8 ||''|| size10 ||''|| size12 ||''|| size14 ||''|| size16 ||''|| size18 ||''|| size20 ||''|| size22 ||''|| size24 ||''|| totalsku ||''|| requested_qty '||'|| cargo_receive_milestone ||''|| cargo_receive_actual ||'

Answer : Missing Expression at sql statement

not quite clear as to how removing the [] around the column names will give "FROM keyword not found where expected" error.

can you try the below :

Select period, division, brand, product_type, modetype, vesselname, port_of_origin, supplier, stylecode, cap, master_po_no, size6, size8, size10, size12, size14, size16,
        size18, size20, size22, size24, requested_qty, cargo_receive_milestone, cargo_receive_actual
        into vc_supplier, vc_style_code, vc_cap, vc_master_po_no, num_size6, num_size8, num_size10,
        num_size12, num_size14, num_size16, num_size18, num_size20, num_size22, num_size24, num_size6 + num_size8 + num_size10 + num_size12 + num_size14 + num_size16 + num_size18 + num_size20 + num_size22 + num_size24 as totalsku ,num_requested_qty,
        vc_cargo_receive_milestone, vc_cargo_receive_actual from vital_dashboard_mv
        WHERE period = 1;

Thanks
Random Solutions  
 
programming4us programming4us