Posts

Showing posts from March, 2021

Delete formula line

 select * FROM FM_MATL_DTL WHERE line_no=3 and RELEASE_TYPE='1'  and trunc(LAST_UPDATE_DATE)=trunc(sysdate) SELECT * FROM FM_MATL_DTL WHERE FORMULA_ID=(select FORMULA_ID FROM FM_FORM_MST WHERE FORMULA_NO='940589') AND RELEASE_TYPE='1' delete from FM_MATL_DTL WHERE FORMULALINE_ID='784760' and FORMULA_ID='65818' AND RELEASE_TYPE='1';

Formula Line change query

  SELECT * FROM FM_MATL_DTL WHERE FORMULA_ID=(select FORMULA_ID FROM FM_FORM_MST WHERE FORMULA_NO='941306') AND RELEASE_TYPE='1' update FM_MATL_DTL set LINE_NO=3  WHERE FORMULALINE_ID='799366' and FORMULA_ID='66980' AND RELEASE_TYPE='1'; update FM_MATL_DTL set LINE_NO=1  WHERE FORMULALINE_ID='799367' and FORMULA_ID='66980' AND RELEASE_TYPE='1'; update FM_MATL_DTL set LINE_NO=2  WHERE FORMULALINE_ID='799366' and FORMULA_ID='66980' AND RELEASE_TYPE='1'; delete from FM_MATL_DTL where FORMULALINE_ID='785344' and FORMULA_ID='65865' AND RELEASE_TYPE='1'; update FM_MATL_DTL set LINE_NO=3  WHERE FORMULALINE_ID=(SELECT FORMULALINE_ID FROM FM_MATL_DTL WHERE FORMULA_ID=(select FORMULA_ID FROM FM_FORM_MST WHERE FORMULA_NO='866642') AND RELEASE_TYPE='1' AND LINE_NO='1') AND RELEASE_TYPE='1' AND LINE_NO='1'; update FM_MATL_DTL set LINE_NO=1  WHERE FO

item rate update query in MS sql server

 update ItemHeader set Rate=17 where ItemCode='33130';  update ItemHeader set Rate="&D2&" where ItemCode='"&B2&"'; INSERT INTO [dbo].[ItemHeader] ([ItemCode] ,[ItemClassKey] ,[ItemName] ,[Rate] ,[ItemDiscount] ,[Barcode] ,[CrtnSize] ,[Ast]) VALUES ('"&&"' ,'CL08601' ,'"&&"' ,"&&" ,0 ,'"&&"' ,'S' ,1) Insert into HRM.T_TEST1    (COL1, COL2)  Values    ('50604', 'Dairy');

Duplicate delete records using rowid in oracle

 DELETE FROM XXFG_RCP WHERE rowid not in ( SELECT MIN(rowid) FROM XXFG_RCP GROUP BY COM_NAME, ITEM_CODE, ORG_CODE );