View Images from Database

Dears,
I cannot use TO_BASE64 in my mssql query as it is not recognized function :

 SELECT TO_BASE64(image1)
   from Images_v1 where PO='test1' 

I need to show the image stored in my sql db as you see below:

How to solve this pls

If your database won't do it, and you are sure you do need to convert to base64 (you probably do not), then use jython to convert it after you get it into Ignition. See @Baris.kose's suggestion above.

1 Like

As you said @pturmel ,No need for Base64 ,It worked as below

My version of SQL Server does not have the ability to base64 encode, so I needed to do it in a slightly different way. I use the b64encode function to encode it

from base64 import b64encode

b64Image = "data:imagef;base64,%s"%b64encode(value)
	
return b64Image