You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that request.js has a function validateParameters which goes through all of the request parameters and calls validate on each one's type, passing the parameter's value to check.
The UDT type does not have a validate function defined in data-type.js. This is a problem if you create a request with a UDT parameter and initiate callProcedure on it, because it tries to validate the parameters.
I am willing to contribute to fix this issue. However, I want some input on the best way to address this. There are two good options:
Have validateParameters skip parameters whose type does not have a validate function.
Create a validate function for UDT that does... something. Maybe just returns the value without doing anything?
UDT is not the only type that does not have 'validate' function. This is the full list of types that don't seem to have 'validate' :
INTN, NTEXT, BITN, DECIMALN, NUMERICN, FLTN, MONEYN, DATETIMN, XML, UDTTYPE, SSVARIANTTYPE
I think there is more work to support these parameter types than just adding a dummy 'validate'. If you see the constructor for RpcRequestPayload in rpcrequest-payload.js, it also invokes writeTypeInfo and writeParameterData on the type, and these are also missing for the UDTTYPE as well as the other types listed above.
I think you need real implementations for the three methods at a minimum to support a type - 'validate', 'writeTypeInfo' and 'writeParameterData'.
Seems like there is support for reading UDTTYPE. If you feel inspired to add support for UDTTYPE parameter, a look at readUDTInfo in metadata-parser.js might help.
I get error Invalid column type from bcp client for colid when trying to send geometry types with bulk load. It tries to use varbinary which bcp protocol doesn't seem to like. Think it's related to this same UDT parameters. I'm using through mssql
Hi @samlof, Thanks for bring this one up. If you go to the "Other Data Types" table, under parameter column of UDT's row, you can see it is marked as "-". Maybe you missed this part. We are also looking into better support these types like what Arthur mentioned in #678.
Activity
tvrprasad commentedon Jan 4, 2017
UDT is not the only type that does not have 'validate' function. This is the full list of types that don't seem to have 'validate' :
INTN, NTEXT, BITN, DECIMALN, NUMERICN, FLTN, MONEYN, DATETIMN, XML, UDTTYPE, SSVARIANTTYPE
I think there is more work to support these parameter types than just adding a dummy 'validate'. If you see the constructor for RpcRequestPayload in rpcrequest-payload.js, it also invokes writeTypeInfo and writeParameterData on the type, and these are also missing for the UDTTYPE as well as the other types listed above.
I think you need real implementations for the three methods at a minimum to support a type - 'validate', 'writeTypeInfo' and 'writeParameterData'.
Seems like there is support for reading UDTTYPE. If you feel inspired to add support for UDTTYPE parameter, a look at readUDTInfo in metadata-parser.js might help.
VitorBisterso commentedon Aug 7, 2018
I've also had this problem. To solve it, I just changed "NTEXT" to "VARCHAR". It's still not fixed, please fix.
samlof commentedon Aug 16, 2022
I get error
Invalid column type from bcp client for colidwhen trying to send geometry types with bulk load. It tries to use varbinary which bcp protocol doesn't seem to like. Think it's related to this same UDT parameters. I'm using through mssqlhttp://tediousjs.github.io/tedious/api-datatypes.html at least has UDT listed as not supported as parameters
MichaelSun90 commentedon Aug 17, 2022
Hi @samlof, Thanks for bring this one up. If you go to the "Other Data Types" table, under parameter column of UDT's row, you can see it is marked as "-". Maybe you missed this part. We are also looking into better support these types like what Arthur mentioned in #678.