SQLcl Commands In SQL Developer

thatjeffsmith SQL Developer 2 Comments

Tell Others About This Story:

Many of you might not know that most of what you can do in SQcl, can also be done in SQL Developer version 4.2.

In fact, it’s the same code that handles running statements/scripts in SQLcl as it is in SQL Developer’s SQL Worksheet.

Assuming of course, that you use THIS button.

Runs queries through the script engine, standard output back, versus one or more data grids.

There’s one large exception to this. TODAY: we don’t allow you to use the SCRIPT command, yet.

And one small exception: you can ALIAS a command, but it won’t persist between SQL Developer sessions. We’re not maintaining an ALIASES file in SQL Developer.

If you close SQLDev and re-open it, my PEEPS command will be gone. You could add these via a LOGIN.SQL script though…

How to use it.

Simple, key in your SQL*Plus or SQlcl commands into a worksheet. Hit F5. See the output below.

Here’s an example with our bigger and better DESC – INFO.

INFO+ is like INFO except we show you column stats instead of column comments.

Now, let’s get the DDL for a table, spool it to a file, format the file using SQL Developer’s formatter, and then print the contents of the file.

A mix of SQL*Plus and SQLcl commands, no problem in SQL Developer.

We Also Support @SCRIPT

You can always tell SQL Developer to execute a script using the @ syntax. Simply point to the file – either on your machine or out on the scary INTERNET.

@http://…file.sql and run with F5

Related Posts Plugin for WordPress, Blogger...
Tell Others About This Story:

Comments 2

  1. We use to run lot of scripts in sql plus to support business applications. We copy the script into a folder in a windows machine and then at sql plus command prompt type @ and drag and drop the script which will paste the full path of the script along with name of the script, this makes our life easy. Can this be achieved in sql Dev the same way sql plus support. I tried doing drag and drop in sql Dev but it copy the contents of the script instead of copying the path and script name, which doesn’t fullfill the purpose.

    1. thatjeffsmith Post
      Author

Leave a Reply

Your email address will not be published. Required fields are marked *