Did you know you can run SQL*Plus type scripts directly from the web?

Now, I’m going to assume the following:

  • You know, trust, and have tested these scripts
  • You don’t assume that everything on the Internet is true
  • That Tim doesn’t think I’m trying to suck up to him, much

So, in a SQL Worksheet, run your script, and just reference the URL of the file in question. Store your scripts on Dropbox, perhaps?

I’m lazy so I’m just going to borrow the aforementioned Tim’s script up on ORACLE-BASE.

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

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

12 Comments

  1. Harry Taieb Reply

    Pre-requisit : Access to http site has to be opened . Otherwise :
    SP2-0920: HTTP error ‘403 Forbidden’ on attempt to open URL

    Regards,

    Harry

    • If you can’t get to his site, try uploading your own .SQL file to a service like dropbox and use the share URL to try it out.

  2. Yes, just tried with the same sql script:
    @http://www.oracle-base.com/dba/monitoring/sql_area.sql

    As Rajesh wss telling only the query results are in the output.

    But a nice feature anyway.

    SQL Developer Version 4.0.2.15

    • set echo on
      @http://www.oracle-base.com/dba/monitoring/sql_area.sql

      gives the output as in the screenshot.

    • Sorry for posting again, but I have a couple of questions, which are kind of related to this topic:
      1. Is there any way to configure the default values for the SQLPlus-like commands one can use in sql worksheet. As in this case, I was expecting echo to be on by default, but opening a new sql worksheet and running “SHOW ALL” command tells me that echo is off by default.
      2. It seems that SHOW ALL does not list all of the available SET commands. For example, there is no “set autodblink on” command, which is really great by the way and thanks to Vadim for posting about it on his blog. The question is, are there any other “secret” commands, which are not listed by SHOW ALL, or maybe it isn’t secret and there is some other place to see them all?

    • 1 – Yes. Just create a login script and have SQLDev fire that on new connections. I’ve blogged about that before – search for something SERVEROUTPUT and DEFAULT.

      2 – We’re looking to have our SQL*Plus command set be MUCH closer to 100% compatibility with SQL*Plus itself, so this will get better.

  3. Here is what i did Jeff,

    1) Opened a new worksheet in SQL Developer 4.0.2
    2) Just pasted the below statement at line#1
    @http://www.oracle-base.com/dba/monitoring/sql_area.sql

    3) just selected the above statement and pressed F5

    but i dont the see the output like yours, instead i got the query executed and result set as output.

  4. I tried this on SQL Developer 4.0.2

    @http://www.oracle-base.com/dba/monitoring/sql_area.sql

    and clicked F5 I don’t see the output like you, instead in see the results for the query. are you sure is this on 4.0.2 ?

    • Yes, version 4.0.2 – but should be true for just about any version, this is an old feature.

      Do you have any other queries in your worksheet?

      What query output when to a grid exactly – are you saying you ran the script SQL statement over the web as a single statement and got a grid back?

Write A Comment