0% found this document useful (0 votes)
12 views6 pages

SQL Query - UAT Tested - V4.0

The document outlines various SQL queries related to item management, including item creation, supplier information, sourcing countries, and retail pricing. Each section provides distinct queries to retrieve specific attributes and details about items, suppliers, and their classifications based on update statuses and other criteria. The queries are structured to filter items based on their last update ID and date, ensuring only relevant and recent data is retrieved.

Uploaded by

jsmehta1107
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views6 pages

SQL Query - UAT Tested - V4.0

The document outlines various SQL queries related to item management, including item creation, supplier information, sourcing countries, and retail pricing. Each section provides distinct queries to retrieve specific attributes and details about items, suppliers, and their classifications based on update statuses and other criteria. The queries are structured to filter items based on their last update ID and date, ensuring only relevant and recent data is retrieved.

Uploaded by

jsmehta1107
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

Item Creation Screen and Main Item View Screen

=============================================
select distinct a.status,
a.item,
decode(a.item_number_type,'ITEM','Regular Item',a.item_number_type)
item_number_type,
decode(a.sellable_ind,'Y','Yes',a.sellable_ind) sellable_ind,
decode(a.orderable_ind,'Y','Yes',a.orderable_ind) orderable_ind,
decode(a.inventory_ind,'Y','Yes',a.inventory_ind) inventory_ind,
a.dept,
dp.DEPT_NAME,
a.Class,
cl.CLASS_NAME,
a.subclass,
scl.SUB_NAME,
cd.code_desc,
decode(a.tran_level,'1','SKU',a.tran_level) tran_level,
a.item_desc,
a.short_desc,
a.cost_zone_group_id,
decode(a.store_ord_mult,'I','Inner Pack',a.store_ord_mult) store_ord_mult,
-- b.selling_uom,
a.last_update_id,
a.LAST_UPDATE_DATETIME
from item_master a,
-- item_loc b ,
code_detail cd,
deps dp,
class cl,
subclass scl
where dp.dept = a.dept
and cl.dept = dp.dept
and scl.dept = cl.dept
and a.item_level=1
--and a.status='A'
and cd.code_type='UPCT'
and a.item_number_type=cd.code
and a.dept=dp.dept
and dp.dept = 110
and cl.dept = dp.dept
and scl.dept = cl.dept
and scl.class = cl.class
and a.class= cl.CLASS
and a.subclass =scl.subclass
and a.LAST_UPDATE_ID in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and trunc(a.last_update_datetime) < trunc(sysdate);

===================================================================================
==========================
Supplier Screen --- same item , supplier parent is diff hence u can have 2 or more
records for the same item
===================================================================================
============================

select distinct a.item,


sups.supplier_parent supplier_parent,
a.supplier Supplier,
sups.SUP_NAME,
a.primary_supp_ind "Primary SupplierInd",
a.vpn "VPN",
item_master.LAST_UPDATE_ID,
item_master.last_update_datetime
from item_supplier a ,
sups ,
item_master ,
code_detail cd
where a.supplier=sups.supplier
and a.item=item_master.item
and item_master.LAST_UPDATE_ID in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and trunc(item_master.last_update_datetime) < trunc(sysdate)
--and item_master.STATUS='A'
and item_master.item_level=1;

=======================================================
Item Supplier - COuntry Of Sourcing
==================================

select isc.item,
isc.origin_country_id,
isc.unit_cost,
sups.CURRENCY_CODE,
isc.inner_pack_size INNER,
isc.supp_pack_size OUTER,
isc.ti,
isc.hi,
im.create_datetime createdate,
im.last_update_datetime Lastupdate,
isc.last_update_datetime iscdate
from item_supp_country isc,
sups,
item_master im
where im.item = isc.item
and isc.supplier = sups.SUPPLIER
and im.LAST_UPDATE_ID in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and trunc(im.LAST_UPDATE_DATETIME) < trunc(sysdate);

==========================================================

Item Country Of Manufacture


=================================

select distinct ism.item,ism.manu_country_id


from item_supp_manu_country ism, item_master
where ism.item=item_master.item
and item_master.LAST_UPDATE_ID in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and trunc(item_master.LAST_UPDATE_DATETIME) < trunc(sysdate)
--and item_master.status='A'
and item_master.ITEM_LEVEL=1;

===================================================================================
=========

Retail By Zone --- Same item can have different unit retails hence more no of
records
===================================================================================
=======

select distinct izp.item,izp.selling_unit_retail as unit_retail


from item_zone_price izp,item_master
where izp.item=item_master.item
and item_master.LAST_UPDATE_ID in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and trunc(item_master.LAST_UPDATE_DATETIME ) < trunc(sysdate)
--and item_master.status='A'
and item_master.ITEM_LEVEL=1;

================
Locations
==================

select il.Item
,decode(il.source_method,'S','Supplier','W','WH','Unknown') "Source Method"
--, max (decode (il.source_method, 'W', 'Y', null)) "All Stores"
, max (decode (il.loc, 7581, decode(il.source_method,'S','Y','W','',null)))
"7581"
, max (decode (il.loc, 7587, decode(il.source_method,'S','Y','W','',null)))
"7587"
, max (decode (il.loc, 7749, decode(il.source_method,'S','Y','W','',null)))
"7749"
, max (decode (il.loc, 7585, decode(il.source_method,'S','Y','W','',null)))
"7585"
, max (decode (il.loc, 7741, decode(il.source_method,'S','Y','W','',null)))
"7741"
, max (decode (il.loc, 7583, decode(il.source_method,'S','Y','W','',null)))
"7583"
from item_loc il,
Item_master im
where im.item=il.item
and im.item_level = 1
and im.last_update_id in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and trunc(im.last_update_datetime) < trunc(sysdate)
group by il.item,decode(il.source_method,'S','Supplier','W','WH','Unknown');

=========================
Children
=========

select distinct b.item,


decode((select a.item_number_type
from item_master a
where a.item_level = 2
and a.item_parent = b.item
and a.primary_ref_item_ind= 'Y'),'EAN13','EAN/UCC-13','') UPC_Type,
(select a.item
from item_master a
where a.item_level = 2
and a.item_parent = b.item
and a.primary_ref_item_ind= 'Y')Primary_UPC,
decode((select a.item_number_type
from item_master a
where a.item_level = 2
and a.item_parent = b.item
and a.primary_ref_item_ind= 'N'
and rownum =1),'EAN13','EAN/UCC-13','')Secondary_UPC_Type,
(select a.item
from item_master a
where a.item_level = 2
and a.item_parent = b.item
and a.primary_ref_item_ind= 'N'
and rownum = 1)Secondary_UPC
from item_master b
where b.item_level = 1
and b.last_update_id in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
--and b.status='A'
and trunc(b.last_update_datetime) < trunc(sysdate);

========
Generic Item Atributes
==============

select distinct hi.item,hi.dang_good_fl,hi.dang_good_cls,hi.hazchem_cd,


hi.blk_hvy_good_fl,hi.qa_aprv_fl,hi.shlf_rdy_tray_fl,
hi.pkg_type,img_line_fl
from hi_generic_itm_atrb hi, item_master b
where b.last_update_id in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and hi.item=b.item
--and b.status='A'
and b.item_level=1
and trunc(b.last_update_datetime) < trunc(sysdate);

===================

UDA - LOV
===============
select uil.item,
max(decode(uil.uda_value,'1004','Y','1005','N')) "Age Restricted Product
Y/N",
max(decode(uil.uda_value,'1006','Y','1007','N')) "Available Assembled",
max(decode(uil.uda_value,'1009','N','1008','Y')) "Bin Located Y/N",
max(decode(uil.uda_value,'1009','N','1008','Y')) "Bin Located Y/N",
max(decode(uil.uda_value,'1070','Private Label','1071','Exclusive
Brand','1072','Vendor Brand')) "Brand Type",
max(decode(uil.uda_value,'1073','Job Buy','1074','Push','1075','Pull')) "Buy
Type",
max(decode(uil.uda_value,'1057','N','1056','Y','1065','SRT')) "Cartoned",
max(decode(uil.uda_value,'1058','Y','1059','N')) "Expanded Plastic",
max(decode(uil.uda_value,'1049','Test 1','1050','Test 2')) "Fuel Source
Identifier",
max(decode(uil.uda_value,'1060','Y','1061','N')) "Hazardous Substance Y/N ",
max(decode(uil.uda_value,'1066','G','1067','KG','1068','ML','1069','L'))
"Hazardous UOM",
max(decode(uil.uda_value,'1033','Y','1034','N')) "MSDS",

max(decode(uil.uda_value,'1076','NAP','1077','NAV','1063','N','1064','PART','1078',
'RXTS','1062','Y')) "Packaging Group",
max(decode(uil.uda_value,'1028','I','1029','II','1030','III')) "Packaging
Group",
max(decode(uil.uda_value,'1053','Test 1','1054','Test 2')) "Prefix",
max(decode(uil.uda_value,'1014','Y','1015','N')) "Product Return Indicator",
max(decode(uil.uda_value,'1012','Y','1013','N')) "Timber Content"
from uda_item_lov uil,
item_master im
where im.item = uil.item
and im.last_update_id in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and trunc(im.last_update_datetime) < trunc(sysdate)
--and im.status='A'
and im.item_level=1
GROUP BY uil.item;

=======================

UDA Date
============

select distinct ui.item,ui.uda_date MSDS_Issue_Date


from uda_item_date ui, item_master im
where ui.uda_id=27
and im.last_update_id in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and ui.item=im.item
and im.status='A'
and im.item_level=1
and trunc(im.last_update_datetime) < trunc(sysdate);

===============
UDA - Free Form
======

select uif.item,
max(decode(uif.uda_id,'14',uif.uda_text,'')) "Available Assembled Charge",
max(decode(uif.uda_id,'8',uif.uda_text,'')) "Barcoded Product",
max(decode(uif.uda_id,'11',uif.uda_text,'')) "Brand",
max(decode(uif.uda_id,'12',uif.uda_text,'')) "Color",
max(decode(uif.uda_id,'66',uif.uda_text,'')) "Commodity Characteristic",
max(decode(uif.uda_id,'18',uif.uda_text,'')) "DG Sub Rick Detail",
max(decode(uif.uda_id,'6',uif.uda_text,'')) "Danks #",
max(decode(uif.uda_id,'24',uif.uda_text,'')) "Flash Point",
max(decode(uif.uda_id,'73',uif.uda_text,'')) "Job Lot Quantity",
max(decode(uif.uda_id,'7',uif.uda_text,'')) "Lowes #",
max(decode(uif.uda_id,'28',uif.uda_text,'')) "Poisons Schedule",
max(decode(uif.uda_id,'67',uif.uda_text,'')) "Storage Classification",
max(decode(uif.uda_id,'4',uif.uda_text,'')) "Supplier Type",
max(decode(uif.uda_id,'29',uif.uda_text,'')) "UN Number",
max(decode(uif.uda_id,'25',uif.uda_text,'')) "Unit Volume"
from uda_item_ff uif,
item_master im
where im.item = uif.item
and im.last_update_id in
('XSVI5','XVKI1','XASAZ','XPRN8','XRGNN','XSKRU','XVTN6','XMWO6','XSSAC','XFJN1','X
RTA2','XVRI2','XNND4','XKTI9','XMPAG','XMSLE','XKDYM','XKRYF','XLKN7','XRRN1','XSPM
4')
and trunc(im.last_update_datetime) < trunc(sysdate)
--and im.status='A'
and im.item_level=1
group by uif.item;

==

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy