Tuesday, July 22, 2025

stringify() or to_string() ?

While I was experimenting with genAI LLMs applied to generating PL/SQL code, I noticed that Claude-Sonnet created a function containing a stringify() method applied to a JSON_ELEMENT_T variable, a method whose existence I wasn't aware of.
l_string := j_elem.stringify();

This method is documented in the serialization methods paragraph in Oracle23ai JSON Developer's Guide, but it turns out that it works also in Oracle19c (at least on version 19.21.0.0.0) even if the guide doesn't mention it.

As far as I could see it's equivalent to method to_string(), so you can pick whichever you like.

No comments:

Post a Comment

I appreciate your comment however bear in mind that I might not have the time to reply soon.
Normally I do not reply to all comments but I am glad if you found something useful or if you learned something new, in that case I strongly encourage you to promote the article with the +1 google button.
Flavio