Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Lower case string preserving inner single quote

Angelo StramieriJan 20 2024 — edited Jan 20 2024

Hi everyone,

I have a portion of PL/SQL code that dynamically generates insert statements.
Since I'm a perfectionist, I would like the code to be formatted entirely in lower case, but some pieces need to be preserved in the original format (otherwise the code doesn't work properly). I'll give you a simplified example.

declare
  v_string varchar2(100);
begin
  v_string := 'insert into my_table (col1, col2) values (1, ''ORACLE'')';
  v_string := lower(v_string);
  dbms_output.put_line(v_string);
end;

As you can verify, this piece of code modifies the entire content of the string and does not preserve the internal single quoted string capitalized ('ORACLE').

Any ideas on how I can do it?

Thanky you.

This post has been answered by mathguy on Jan 21 2024
Jump to Answer
Comments
Post Details
Added on Jan 20 2024
6 comments
207 views