Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLDeveloper changing case (breaking formatting)

Using SQLDeveloper 2.1.1.64, if you try typing the following code:

DECLARE
  v_status_code NUMBER;
  v_status_text VARCHAR2(30);
  v_to_delete   NUMBER := 5;
BEGIN
  PACKAGE_NAME.Delete(v_to_delete, v_status_code, v_status_text);
END;

Pressing Enter after the PACKAGE_NAME.Delete(...) line will make Delete go into all caps (DELETE). I have turned off Case Change in the SQL Formatter options but this still happens. I get other problems similar to this one, where it will randomly reformat lines of code, but I couldn't think of an example as consistent as this. The specific package name doesn't matter, and it does this even if PACKAGE_NAME is in UpperCamelCase.

I don't know if this is a bug with SQLDeveloper or if I'm missing some settings somewhere. It seems as though the SQL Formatter settings under Tools > Preferences > Database > SQL Formatter > Oracle Formatting don't do it, so I don't know what to do. It's getting annoying having to catch some of these format changes, which I sometimes only notice when doing a diff.

like image 653
Jerr Avatar asked Jun 28 '10 17:06

Jerr


People also ask

How do I beautify a code in SQL Developer?

You can press CTRL+F7 (on Windows) to format the SQL code in your current Code Editor window to update the formatting of the code based on any format changes you have made. There is no shortcut set on Mac for formatting SQL code. You can right-click in the Editor and select Format.

How do I turn off auto capitalization in SQL Developer?

Try disabling Code Editor - Completion Insight - Change case as you type and/or Database - SQL Formatter - Autoformat... Hope that helps, K. You can always define how you want to format the SQL or normal text by using the keyboard CTRL+' to manage text/keyword case to all UPPERCASE, Initcap, or all lowercase.

How do I change case in SQL Developer?

Under Tools->Preferences->Shortcut Keys you can find and/or define the shortcut key combination for the Convert Selection to Uppercase and Convert Selection to Lowercase commands. I have mine mapped to CTRL + U and CTRL + L respectively.

How do I beautify a query in PL SQL Developer?

You must select your query and then click PL/SQL Beautifier button. Save this answer.


2 Answers

Under Tools > Preferences > Code Editor > Completion Insight there is an option for 'Change case as you type'.

But I do not think it will do what you are looking for. Unchecked it will either make it all lower case or all uppercase depending on what you have inputted so far. I am not sure if it will do it the way you are wanting.

like image 144
Jacob Schoen Avatar answered Oct 09 '22 23:10

Jacob Schoen


I believe you want to disable the annoying option that is changing to UPPERCASE text when you type. Go to Tools > Preferences > Code Editor > Completion Insight > Uncheck "Change case as you type"

like image 40
Edwin Segura Avatar answered Oct 09 '22 23:10

Edwin Segura