We have a script execution directory setting in SQL Developer…but what about our new SQLcl command line utility?
That was a question posed to me this morning.
My answer was..well, let me show you my answer.
┌─[16:31:49]─[wvu1999]─[MacBook-Air-Smith]:~/sqlclNEW$ └─>cat login.sql SET sqlprompt "_user '@' _connect_identifier >" SET sqlformat ansiconsole cd /Users/wvu1999/scripts ┌─[16:31:57]─[wvu1999]─[MacBook-Air-Smith]:~/sqlclNEW$ └─>
Now you can see why:
- My prompt is what it is
- My output is formatted nicely
- My script is able to be found
In Case This is All New to You…
SQLcl is a new take on SQL*Plus brought to you by the SQL Developer team.
CD is a new command available. From the HELP…
SET SQLFORMAT allows to you predefine your output to JSON, CSV, HTML, INSERTS..and also to set a ANSICONSOLE for pretty coloring and nicer text spacing and formatting.
This works in SQL Developer, too!
Use the CD command to change where the GUI looks for your files to execute AND where files will be written to.
By default, it’s the %user/temp% directory, as supplied by the OS.
When the script engine goes to write the CSV file, it will do so in my c:\users\jdsmith directory. And this $SQLPATH will be maintained for the duration of my SQL Developer instance….until I change it again 🙂