BF [ 2531025 ] M_InOutLine.M_Locator_ID should be mandatory

http://sourceforge.net/tracker/?func=detail&atid=879332&aid=2531025&group_id=176962
This commit is contained in:
teo_sarca 2009-02-04 12:24:04 +00:00
parent d0649726f5
commit be02c3cf53
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,21 @@
-- Update M_Locator_ID NULL columns using first locator form InOut header warehouse
UPDATE M_InOutLine iol SET M_Locator_ID = (
SELECT MIN(loc.M_Locator_ID)
FROM M_InOut io
INNER JOIN M_Warehouse wh ON (wh.M_Warehouse_ID=io.M_Warehouse_ID)
INNER JOIN M_Locator loc ON (loc.M_Warehouse_ID=wh.M_Warehouse_ID)
WHERE io.M_InOut_ID=iol.M_InOut_ID
)
WHERE iol.M_Locator_ID is null
;
-- 04.02.2009 14:17:53 EET
--
ALTER TABLE M_InOutLine MODIFY M_Locator_ID NUMBER(10)
;
-- 04.02.2009 14:17:53 EET
--
ALTER TABLE M_InOutLine MODIFY M_Locator_ID NOT NULL
;

View File

@ -0,0 +1,21 @@
-- Update M_Locator_ID NULL columns using first locator form InOut header warehouse
UPDATE M_InOutLine iol SET M_Locator_ID = (
SELECT MIN(loc.M_Locator_ID)
FROM M_InOut io
INNER JOIN M_Warehouse wh ON (wh.M_Warehouse_ID=io.M_Warehouse_ID)
INNER JOIN M_Locator loc ON (loc.M_Warehouse_ID=wh.M_Warehouse_ID)
WHERE io.M_InOut_ID=iol.M_InOut_ID
)
WHERE iol.M_Locator_ID is null
;
-- 04.02.2009 14:17:53 EET
--
insert into t_alter_column values('m_inoutline','M_Locator_ID','NUMERIC(10)',null,null)
;
-- 04.02.2009 14:17:53 EET
--
insert into t_alter_column values('m_inoutline','M_Locator_ID',null,'NOT NULL',null)
;