05.09.2012, 17:17 | #1 |
Участник
|
Уменьшение кол-ва полей в запросе
Для уменьшения количества полей в курсоре пишу, например так -
X++: this.itemGroupId = (select ItemId, itemGroupId, RecId from InventTable where InventTable.ItemId == inventTrans.itemId).itemGroupId; X++: SELECT /*+ INDEX(A I_175ITEMIDX) FIRST_ROWS */A.ITEMGROUPID,A.ITEMID,A.ITEMNAME,A.ITEMTYPE,A.PURCHMODEL,A.HEIGHT,A.WIDTH,A.SALESMODEL,A.COSTGROUPID,A.PRIMARYVENDORID,A.NETWEIGHT,A.DEPTH,A.UNITVOLUME,A.BOMUNITID,A.DENSITY,A.DEL_SCRAPTYPEID,A.DIMENSION,A.DIMENSION2_,A.DIMENSION3_,A.DIMENSION4_,A.COSTMODEL,A.USEALTITEMID,A.ALTITEMID,A.INTRACODE,A.DEL_COVPERINVENTLOCATION,A.PHANTOM,A.INTRAUNIT,A.BOMLEVEL,A.BATCHNUMGROUPID,A.AUTOREPORTFINISHED,A.ORIGCOUNTRYID,A.STATISTICSFACTOR,A.ALTCONFIGID,A.STANDARDCONFIGID,A.DEL_CONFIGACTIVE,A.ABCTIEUP,A.ABCREVENUE,A.ABCVALUE,A.ABCCONTRIBUTIONMARGIN,A.COMMISSIONGROUPID,A.DEL_BARCODE,A.DEL_BARCODETYPE,A.CONFIGURABLE,A.SALESPERCENTMARKUP,A.SALESCONTRIBUTIONRATIO,A.SALESPRICEMODELBASIC,A.MINAVERAGESETTLE,A.NAMEALIAS,A.GROSSDEPTH,A.GROSSWIDTH,A.GROSSHEIGHT,A.STANDARDPALLETQUANTITY,A.QTYPERLAYER,A.SORTCODE,A.CONFIGSIMILAR,A.SERIALNUMGROUPID,A.DIMGROUPID,A.MODELGROUPID,A.ITEMBUYERGROUPID,A.TAXPACKAGINGQTY,A.DEL_TEMPLATE,A.WMSPALLETTYPEID,A.ORIGSTATEID,A.STOPEXPLODEPRICE,A.WMSPICKINGQTYTIME,A.TARAWEIGHT,A.PACKAGINGGROUPID,A.SCRAPVAR,A.SCRAPCONST,A.STANDARDINVENTCOLORID,A.STANDARDINVENTSIZEID,A.ITEMDIMCOMBINATIONAUTOCREATE,A.ITEMDIMCOSTPRICE,A.ALTINVENTSIZEID,A.ALTINVENTCOLORID,A.GROSSWEIGHT_RU,A.PACKING_RU,A.ASSETGROUPID_RU,A.ASSETID_RU,A.K_ITEMVIEWID,A.K_ITEMMATERIALTYPEID,A.K_ITEMPRODUCERID,A.K_ITEMCOLLECTIONID,A.K_ITEMCOLORID,A.K_ITEMSIZEID,A.K_ITEMTNVDID,A.K_ITEMREPLACEID,A.K_ITEMDEPARTMENTID,A.EL_1C_COMPATIBLE,A.EN_NAMEALIAS,A.STANDARDINVENTBATCHID,A.ITEMTHICKNESSID,A.SUPPLY_EL,A.SUPPLY_EL2_,A.SUPPLY_EL3_,A.DELIVERY_EL,A.INVENT_NEGATIVESTOCK_EL,A.EL_UZENEN,A.QTYLAYER,A.MODIFIEDDATE,A.MODIFIEDBY,A.CREATEDDATE,A.CREATEDBY,A.RECVERSION,A.RECID FROM INVENTTABLE A WHERE ((SUBSTR(NLS_LOWER(DATAAREAID),1,3)=NLS_LOWER(:in1)) AND (SUBSTR(NLS_LOWER(ITEMID),1,20)=NLS_LOWER(:in2)))
__________________
Axapta 3.0 sp - хз какой, kr2 |
|
|
За это сообщение автора поблагодарили: S.Kuskov (1). |