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

database/sql: "unsupported type from server string=" #22935

Closed
zhaohansprt opened this issue Nov 30, 2017 · 1 comment
Closed

database/sql: "unsupported type from server string=" #22935

zhaohansprt opened this issue Nov 30, 2017 · 1 comment

Comments

@zhaohansprt
Copy link

@zhaohansprt zhaohansprt commented Nov 30, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.9.2

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

win10 X64 i7 7700HQ

What did you do?

I called a sql server 2012sp3 's proc with output param as the sql.Out example shows
as below:

var strErrorDescribe string
	_, err = db.GetmyssqlDB().ExecContext(context.Background(), "NET_PW_InsureIn",
		sql.Named("dwUserID", m.UserId),
		sql.Named("dwScore", m.MoneyAmount),
		sql.Named("strErrorDescribe", sql.Out{Dest: &strErrorDescribe}))

strErrorDescribe is the NVARCHAR(127) OUTPUT param
but i got err as "unsupported type from server string=存款成功!"
and the 'strErrorDescribe' returned value is ""

What did you expect to see?

strErrorDescribe should contain 存款成功 as returned value

What did you see instead?

the 'strErrorDescribe' returned value is ""

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Nov 30, 2017

For questions about Go, see https://golang.org/wiki/Questions.

@bradfitz bradfitz closed this Nov 30, 2017
@zhaohansprt zhaohansprt changed the title unsupported type from server string= go/src/database/sql/ unsupported type from server string= Nov 30, 2017
@zhaohansprt zhaohansprt changed the title go/src/database/sql/ unsupported type from server string= database/sql: unsupported type from server string= Dec 1, 2017
@zhaohansprt zhaohansprt changed the title database/sql: unsupported type from server string= database/sql: "unsupported type from server string=" Dec 1, 2017
@golang golang locked and limited conversation to collaborators Dec 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.