[Home] [Help]
The following lines contain the word 'select', 'insert', 'update' or 'delete':
select
nvl(l.selling_price,0),
SHPBKLOG.BACKLOG_QTY(l.line_id, l.item_type_code)
from
so_lines l
where
l.header_id = a_header_id and
l.line_type_code <> 'PARENT';
select nvl(min('Y'), 'N')
into SHIPPABLE
from dual
where exists
(select 'shippable detail'
from so_line_details
where line_id = O_LINE_ID
and shippable_flag = 'Y');
select nvl(min('Y'), 'N')
into SOMETHING_RELEASED
from dual
where exists
(select 'released details'
from so_line_details
where nvl(released_flag, 'N') = 'Y'
and line_id = O_LINE_ID);
select nvl(min('Y'), 'N')
into ALL_DETAILS_RELEASED
from dual
where not exists
(select 'unreleased detail'
from so_line_details
where nvl(released_flag, 'N') = 'N'
and line_id = O_LINE_ID);
/* select ordered and cancelled quantity for the order line */
select
ordered_quantity,
nvl(cancelled_quantity, 0)
into
ORDERED_QTY,
CANCELLED_QTY
from
so_lines
where
line_id = O_LINE_ID;
select nvl(min('Y'), 'N')
into ALL_SHIPPABLE_RELEASED
from so_line_details ld
where ld.line_id = O_LINE_ID
and ld.shippable_flag = 'Y'
and ld.inventory_item_id+0 in
(select distinct spl.inventory_item_id+0
from so_picking_lines spl
where spl.order_line_id = O_LINE_ID
and spl.picking_header_id+0 not in (0, -1));
select
pl.picking_line_id
into
dummy
from
so_picking_headers ph,
so_picking_lines pl,
so_lines child,
so_lines parent
where
parent.line_id = O_LINE_ID and
child.parent_line_id = parent.line_id and
child.line_id = pl.order_line_id and
pl.picking_header_id = ph.picking_header_id and
ph.status_code in ('CLOSED', 'PENDING', 'OPEN') and
ROWNUM = 1;
select
ORDERED_QTY -
CANCELLED_QTY -
nvl(floor(min(sum(nvl(pl.shipped_quantity,0))/ max(pl.component_ratio))), 0)
into
MODEL_CLASS_BACK_QTY
from
so_picking_lines pl,
so_picking_headers ph,
so_lines child,
so_lines parent
where
parent.line_id = O_LINE_ID and
child.parent_line_id = parent.line_id and
child.line_id = pl.order_line_id and
pl.picking_header_id = ph.picking_header_id and
ph.status_code in ('CLOSED', 'PENDING', 'OPEN') and
exists
(select 'child is shippable'
from so_line_details ld
where ld.line_id = child.line_id) and
not exists
(SELECT 'UNREPRESENTED COMPONENT'
FROM SO_LINE_DETAILS LD
WHERE LD.LINE_ID = child.LINE_ID
AND LD.SHIPPABLE_FLAG = 'Y'
AND LD.INVENTORY_ITEM_ID+0 NOT IN
(SELECT DISTINCT SPL.INVENTORY_ITEM_ID+0
FROM SO_PICKING_LINES SPL
WHERE SPL.ORDER_LINE_ID = LD.LINE_ID
AND SPL.PICKING_HEADER_ID+0 NOT IN (0, -1)))
group by
pl.inventory_item_id;
select
ORDERED_QTY -
CANCELLED_QTY -
nvl(floor(min(sum(nvl(pl.shipped_quantity,0)) / max(pl.component_ratio))), 0)
into
STANDARD_II_BACK_QTY
from
so_picking_lines pl,
so_picking_headers ph
where
pl.order_line_id = O_LINE_ID and
ph.picking_header_id = pl.picking_header_id and
ph.status_code in ('CLOSED', 'PENDING', 'OPEN')
group by
pl.inventory_item_id;