Named Query parameter datatype

Hi,

Why is ignition generating queries with parameter as nvarchar(4000) even though i selected int4 in the designer?

(@P0 nvarchar(4000))SELECT SAPNO from RECIPE_MAIN where PRODUCTNO = @P0

could it be the datatype for the table column?

Is an int in MSSQL so I don't think that is the issue.

Thank you

How are you calling this function?

If you just want a SELECT, try system.db.runPrepQuery | Ignition User Manual
or, a better option might be using a Named Query with system.db.execQuery | Ignition User Manual or system.db.runScalarPrepQuery | Ignition User Manual