Dealing With The Binary Tables In Infor Visual ERP

All of the specification fields (part, work order, customer order, etc.) in Visual are stored in tables with a _BINARY suffix. And the specification data itself isn’t stored in plain text but rather in IMAGE format. How do you read this data? You need to first convert it to VARBINARY and then to NVARCHAR like so:

SELECT WORKORDER_BASE_ID, CAST(CAST(BITS AS VARBINARY(MAX)) AS NVARCHAR(MAX)) AS WO_SPECIFICATION FROM WORKORDER_BINARY

To insert or update data you need to go in the opposite direction:

UPDATE WORKORDER_BINARY SET BITS = CAST(CAST(CAST('This is a yummy CAST sandwich' AS NVARCHAR(MAX)) AS VARBINARY(MAX)) AS IMAGE), BITS_LENGTH = 29 WHERE WORKORDER_BASE_ID = '40015'