Something Else I Didn’t Know

This one is courtesy of Andrew Campbell at Sun Microsystems. He noticed in an Oracle Magazine article that you can use a URL as a script name in sqlplus.

SQL> select * from v$version;


BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production


SQL> @http://oracledoug.com/test.sql


NAME
---------
ORCL


SQL>

If you check out http://oracledoug.com/test.sql, you’ll see the script that this is running.

We were talking about this at work and perhaps the main use I could think of would be a centralised script repository that didn’t need distribution to multiple servers or any NFS mounts. I’m not sure I can see too many people using this extensively, but it’s nice to learn a new quirk.

4 comments

  1. I noticed that Pete Finnigan blogged about this sqlplus feature and asked him if he wanted to comment here to highlight some of the issues around using URLs, but you can find Pete’s comments here.

    http://www.petefinnigan.com/weblog/archives/00000694.htm

    Personally I would have thought the possible security implications were obvious, but it’s best to be careful where security is concerned.

    It’s always good to hear other points of view.

    Cheers,

    Doug

Leave a comment

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