Does anyone know of a way to store values as NVARCHAR in a manually created query in ColdFusion using the querynew() function? I have multiple parts of a largish program relying on using a query as an input point to construct an excel worksheet (using Ben’s POI) so it’s somewhat important I can continue to use it as a query to avoid a relatively large rewrite.
The problem came up when a user tried storing something that is outside of the VARCHAR range, some Japanese characters and such.
Edit: If this is not possible, and you are 100% sure, I’d like to know that too 🙂
When creating a ColdFusion query with queryNew(), you can pass a list of datatypes as a second argument. For example:
Alternatively, you can use cf_sql_varchar (which you would use in queryparam tags). According to the livedocs, nvarchar is accepted for the CF varchar data type.
QueryParam livedoc (referenced for nvarchar data type)
QueryNew livedoc (referenced for data type definition)
Managing Data Types livedoc (referenced for using cf_sql_datatype)