And this is another PITA sponsored by our good friends of
After being struggling whit this issue for a whole day, I finally figure it out. There is a bunch of posts on the web saying that you should change the column type on the table from let’s say LONG to CLOB or stuff like that… but I have tried it and it has no effect if you are working with C# (maybe make sense if you are working with PL. I’m not sure, haven’t test it). The thing is even if you change the column type, you’ll still get an error saying “the string literal is too long…” The way to insert strings larger than 4K into Oracle databases is using bindings. And yes, you can insert 4k plus strings into LONG columns, there is no such 4k limit. This is how you do that:
* I skip error handling, disposing objects, etc… just for
brevity, of course you shouldn't ;)
Another interesting thing that almost every posts got wrong is that you don’t have to specify the parameter type, the library will choose the right type for you. So don’t waste your time on that.
Post a Comment