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

Oracle clob插入时判断长度需要转一下字节数 #15

Open
fengyunsmile opened this issue Dec 20, 2018 · 0 comments
Open

Oracle clob插入时判断长度需要转一下字节数 #15

fengyunsmile opened this issue Dec 20, 2018 · 0 comments

Comments

@fengyunsmile
Copy link

fengyunsmile commented Dec 20, 2018

最近开发遇到插入数据类型是clob,文字数接近2000个的时候报ORA-01461: 仅能绑定要插入 LONG 列的 LONG 值。查到最后发现 用执行sql 传入OracleParameter 设置类型为 clob 时可以插入。看了下代码发现有判断字符串大于4000时设置为clob,不过由于oracle 默认字符集是AL32UTF8的,2000左右长度文字转换后字节数大于4000,报出了这个错,所以这边应该转一下字节数进行判断。

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