-
Notifications
You must be signed in to change notification settings - Fork 921
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
DB2 dialect enhancements #2058
DB2 dialect enhancements #2058
Conversation
6cacdc6
to
61151cc
Compare
61151cc
to
ab0148f
Compare
cmd.Parameters[index].Value = Convert.ToByte(value); | ||
} | ||
var dp = cmd.Parameters[index]; | ||
dp.Value = dp.DbType == DbType.Int16 ? Convert.ToInt16(value) : Convert.ToByte(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DB2 does not support byte native (as many other RDBMS) and has a problem handling it. If the value is of type byte
the provider remaps the parameter as DbType.Binary
. Then it throws InvalidCastException
trying to cast the value to byte[]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
(Unfortunately for some reasons my local db2 installation is no more working, and reinstalling it has not worked either. So I have not checked the tests myself.)
I'm using this docker image (gladly they have made it at least working from a first attempt): https://hub.docker.com/_/db2-developer-c-edition (need to "purchase" it). Also, it seems the image accepts only "testdb" as a database name. And this DB2 driver: IBM.Data.DB2.Core. The packaging is strange and in contradiction to how other packages are working you need to install different versions for Linux or MacOS |
substring
function registrationcurrent_timestamp
function registrationround
function registrationReplaces #474