Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML queries give nil result #168

Closed
ilog2000 opened this issue Sep 5, 2016 · 1 comment
Closed

XML queries give nil result #168

ilog2000 opened this issue Sep 5, 2016 · 1 comment

Comments

@ilog2000
Copy link

ilog2000 commented Sep 5, 2016

Including XML queries gives Scan errors in Rows like "column value is nil, and cannot be converted to *string". My guess, this is because of lack of escaping.

SELECT t.Id, t.Xml.value('(/root/item/custom_id)[1]', 'varchar(50)') AS CustomId FROM MyTable t

@ilog2000
Copy link
Author

ilog2000 commented Sep 6, 2016

My bad, the column contained absolutely unexpected null, so the error was just about using String instead of db.NullString in the struct,

@ilog2000 ilog2000 closed this as completed Sep 6, 2016
gabrielcorado pushed a commit to gravitational/go-mssqldb that referenced this issue Oct 4, 2024
* Reserve extra space for out parameter + tests.

* Test for []byte parameter.

---------

Co-authored-by: El-76 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant