SqlDbx Forum

SqlDbx

You are not logged in.

#1 2012-06-01 11:31:31

garbuya
Member

Changing case should not change literals

I noticed, that if you change case using Ctrl+Shift+U or Ctrl+Shift+L it also changes case of the text literals surrounded by single or double qutes and changes the case of comments.

Not sure about comments, but literals definetely should stay as is.
It may completely mess up the results if case of literal is a part of your predicates.
It also makes your report ugly if you use double quotes literals to make a nice headers.

Case change should only apply to code.

Most SQL editors do not change case of literals.

Last edited by garbuya (2013-12-16 11:26:23)

Offline

#2 2012-06-01 19:50:56

sqldbxhelp
Administrator

Re: Changing case should not change literals

I am not aware of any editor which works this way.
And if editor like this exist I do not agree with the behavior.
If you explicitly select to convert something to upper / lower case everything should be converted

Offline

#3 2012-06-07 12:11:47

garbuya
Member

Re: Changing case should not change literals

Offline

#4 2012-06-07 12:57:35

maac2002
Member

Re: Changing case should not change literals

In this case i agree with garbuya,
by logic, the intended and correct behavior
is to not affect the original value of
variables. Anyway, this could be
specified in a optional setting.

Offline

#5 2012-10-02 14:44:30

garbuya
Member

Re: Changing case should not change literals

Here is an example: Oracle regexp_replace uses CASE SENSITIVE expressions like [:digit:] , [:alnum:], [:alpha:], [:blank:] etc
If you change case of  it you are in a big trouble!
select regexp_instr('500 Oracle Pkwy, Redwood Shores, CA', '[o][[:alpha:]]{3}', 1, 1, 0, 'i') result from dual;
Try to change the case to upper and see what happends!

Offline

#6 2013-07-02 08:41:30

garbuya
Member

Re: Changing case should not change literals

I would like to raise this question again - changing case SHOULD NOT impact literals! Otherwise it is absolutely useless! Otherwise it turns a nice developmnent tool into the stupid word processor!
And, BTW, many word processors today can recognize a dialect of code and live literals alone when you changing case.

I want to change case of a long script with literals in one click, but i cannot! I have to go and higlight each piece of code I want to change! Noncense!

Try to convert to upper this code and see what happends:

select regexp_instr('500 Oracle Pkwy, Redwood Shores, CA', '[o][[:alpha:]]{3}', 1, 1, 0, 'i') result from dual;

Now tell, how easy is it to convert this code to upper case and still have it work?
What if you have pages of code like this?

Offline

#7 2013-12-02 10:26:39

garbuya
Member

Re: Changing case should not change literals

This question still remains unanswered

Offline

#8 2014-06-09 08:46:56

garbuya
Member

Re: Changing case should not change literals

Well..
I looks like I need to open a new thread to have this discussion continued...

Offline

#9 2014-06-09 20:42:09

sqldbxhelp
Administrator

Re: Changing case should not change literals

The way upper case conversion works will stay. We are not going to change it.
Why don't you try to use SQL Formatter option to do what you want.

Offline

Board footer

Powered by FluxBB