![sql tabs to sapces sql tabs to sapces](https://pumh.trans-wentk.pl/templates/64af9ff6ec07d70d68e9adf4e68843a5/img/766238c01df2a381650f8df97baa4c93.jpg)
I assume from your answer that that's not an option (or not at this time, anyway). (It also did - and the new platform definitely does - with consecutive spaces at the beginning of a line, but those are easier to handle.) So, a solution where a keyboard tab is converted to space characters in the code, as we type, WHEN USED FOR INDENTATION ONLY, while preserving tabs (not converting them) anywhere else, or at least preserving them in literals, would still make good sense. Honestly I didn't try on the new platform yet (new from October last year, or whenever it was), but on the old platform, the website editor did all sorts of funny things with tabs.
SQL TABS TO SAPCES CODE
For example, I very often write code in SQL Developer and then post it here (almost exclusively in SQL & PL/SQL). Now - this is indeed a good solution, because it doesn't cause problems in text literals, and also if I change my preferences for indentation, or if I share my code with someone else who has different preferences, all that must be changed is the setting in the GUI, not the source code itself.īut it is not perfect. (Note how the wording in the interface is misleading: it says "indent with spaces" but in fact that setting replaces all tabs, wherever they are typed, with spaces nothing to do with "indentation" alone.) In particular, tabs in text literals should still be preserved, not replaced with spaces - even if we use "space" for indentation. Only tabs used for indentation should be replaced. My initial question was, even if we use "space" and not "tab" for indentation, that shouldn't mean that all tabs should be replaced with spaces. This answers part of my question, and it is a good option to know about.
![sql tabs to sapces sql tabs to sapces](https://i.pinimg.com/originals/1f/74/38/1f7438f64f7b16b68ab1c6836c71e1dc.png)
I know there are workarounds, but that is not the question. Or if I am writing a WHERE clause comparing to a string with tabs. If you wonder, "your strings should be stored in tables, when do you ever care about typing hard-coded strings at the console?" - there are many cases a simple one is while I am typing a regular expression and I must type a tab as part of the regexp. In the example below, I typed the string in Text Editor (standard application on Oracle Linux) and pasted in SQL Developer: select dump('a b') as result from dual
![sql tabs to sapces sql tabs to sapces](https://www.mssqltips.com/tipimages2/5357_tabs-vs-spaces-impact-sql-server-performance.006.png)
If I type the same string (with a tab) in a different application, then I copy it and paste it in the SQL Developer editor, the tab is not converted to spaces. Note that this only happens when I type the command at the keyboard. If in fact tabs are hard-replaced with spaces, OK, but that shouldn't happen in data - in text literals.) (Now, I don't know much about computing in general, and "intellisense" type features in particular but in my narrow mind, code of any kind should preserve tabs wherever they are typed, and the GUI should only display tabs on screen as so-many-spaces. And if it did that in the code, it would be no problem - but it shouldn't be allowed to change the data I type on my keyboard. So, it's not just that the editor renders a tab as two spaces - it actually changes the text itself. But look at what DUMP() reports: select dump('a b') as result from dual - I typed TAB between a and b While I am typing the SELECT statement below, in the string I type the letter a, then a TAB, and then the letter b. I can't prove what I am doing, so you will need to trust me. That makes perfect sense in code, but it shouldn't be allowed to happen in data (meaning: while I am typing a hard-coded string literal in single quotes, for example). When I type "at the console" (meaning, on my keyboard) in the SQL Developer editor, tabs are converted to two spaces (my choice). SQL Developer 18.1.0.095 on top of Oracle Linux Server 7.9 Is this a bug, or just an annoyance? Something that could be addressed? Or just something I am misunderstanding or I am doing wrong?