t3rmian / devpot

A coder's blog
https://blog.termian.dev
1 stars 0 forks source link

posts/oracle-clob-intellij-data-extractor/ #125

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

IntelliJ Data Exporter for lengthy Oracle CLOBs

https://blog.termian.dev/posts/oracle-clob-intellij-data-extractor/

bryanlee-pugh commented 1 year ago

Thank you for this. It saved my day. I encountered one problem with the script, however. It doesn't handle \r \n. If a carriage-return or line-feed is encountered, the expression is thrown off. I am not good with groovy, but I worked around this by adding ".replace('\r', '').replace('\n', '')" right after ".replace(QUOTE, QUOTE + QUOTE)", but that may not work for eeryone. There is probably a way to get the replaceAll to include carriage-return and line-feed so it doesn't have to be removed.

t3rmian commented 11 months ago

@bryanlee-pugh Thank you for your feedback! I'm glad to hear that the data extractor was somewhat helpful for you. Since that, I've revisited the code and have made some updates to handle the concatenation more efficiently. Special characters are now handled through the Oracle's CHR() function. After testing this over various XML/HTML CLOBs, I believe it now covers most of the cases :grinning:.