odbc icon indicating copy to clipboard operation
odbc copied to clipboard

Support for variable size types including json

Open lithiumfrost opened this issue 4 years ago • 2 comments

Currently, if I use the most recent version of the library with this query:

SELECT json_query(labels, '$') as labels FROM data_to_extract_labels WHERE [name] = ?name

I get a Error: unhandled exception: value out of range [RangeDefect] in the getColDetails proc.

If I change that to:

SELECT cast(json_query(labels, '$') as varchar(400)) as labels FROM data_to_extract_labels WHERE [name] = ?name

The query runs correctly.

lithiumfrost avatar Dec 09 '20 20:12 lithiumfrost

hi!

I get the same error with nvarchar(MAX). nvarchar(4000) works fine, but when I change the column to nvarchar(MAX), it fails:

\tests\odbc.nim(335) executeFetch \tests\odbc.nim(307) setupColumns \tests\odbc.nim(295) getColDetails \nim\lib\system\fatal.nim(49) sysFatal Error: unhandled exception: value out of range [RangeDefect]

heigos avatar Dec 17 '20 18:12 heigos

Thanks for this.

It looks like nvarchar(MAX) is a bit of an edge case I need to support. Related to #19

coffeepots avatar Jan 18 '21 21:01 coffeepots