Created a custom field in IPAM named Validated. Want that field to equal "Y" for each IP Address whose status is currently "used" but don't want to do this manually though the IPAM GUI. Have tested SQL select queries to verify the logic I want to use but ran into an issue when I tried to implement using the UPDATE command. Apparently you can not UPDATE a NULL field which leads me to believe I need to use the INSERT INTO command which I have never used. Can someone tell me if you can use a WHERE statement with an INSERT to limit the scope ? Here is the query I want to try
INSERT INTO IPAM_NodeAttrData (Validated) VALUES ( 'Y')
FROM
IPAM_Node LEFT OUTER JOIN IPAM_NodeAttrData ON (IPAM_Node.SubnetId = IPAM_NodeAttrData.SubnetId AND IPAM_Node.IPOrdinal = IPAM_NodeAttrData.IPOrdinal)
WHERE
(
(IPAM_Node.Status = 1) AND
(IPAM_NodeAttrData.Validated IS NULL)
)
Will the FROM and WHERE statements as listed above ensure that only those rows get updated ?