Insert not working

The following insert statement is not working.

insert into CV3CatalogClassTypeValue (SiteID, RepFlags, Build, TouchedBy, TouchedWhen, CreatedBy, CreatedWhen, Active, GUID, CatalogMasterGUID, ClassTypeGUID, Value, MSrepl_tran_version)
(select ct.SiteID,ct.RepFlags,ct.Build,ct.TouchedBy, ct.TouchedWhen, ct.CreatedBy, ct.CreatedWhen, ct.Active, ct.GUID, 70302270, oc.GUID, ct.code, ct.MSrepl_tran_version
from
CV3CatalogClassTypeValue cc,
cv3ordercatalogmasteritem oc,
CV3ClassType ct

where cc.ClassTypeGUID=70302270
and cc.catalogmasterguid=oc.guid
and oc.name='acetaminophen ER tab')

Are you getting an error message, or does the query complete successfully, but no rows are inserted?

If it is the former, please post the error message. If it is the latter, run the SELECT part of the query by itself and see if it returns any rows. If it returns no rows, see what part of the where clause is causing the rows to be eliminated.

2 Likes