Quantcast
Channel: Oracle Bloggers
Viewing all articles
Browse latest Browse all 19780

SQL Developer: Format SQL with CLI

$
0
0

I think it is well known that SQL Developer can format SQL and even it's customizable.

» How to Make Your Code Look Like Steven Feuerstein’s in Oracle SQL Developer

ask SQL Developer to format your code,

I think lesser known is that this is possible with command line.
Here's a sample run on Solaris. I think /dev/stdin and /dev/stdout work on UNIXen.


~/sqldeveloper/sqldeveloper/bin$./sdcli format input=/dev/stdin output=/dev/stdout <<EOF> select    col1,>> col2        , col3      from> TAB1> EOF

 Oracle SQL Developer
 Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.

SELECT col1, col2 , col3 FROM TAB1

I apologize for NOT explaining the details. There are 2 reasons. Once I learn more, I will write another entry.

  1. I downloaded SQLdeveloper from internal server. So, public version may behave a little differently.

  2. I don't fully understand the feature. e.g.) How can I specify the formatting profile?


Viewing all articles
Browse latest Browse all 19780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>