RE: Softball (I hope) - Current Directory in SQLPlus

From: <rajendra.pande_at_ubs.com>
Date: Wed, 18 Dec 2013 16:07:55 -0500
Message-ID: <7E4D006EA3F0D445B62672082A16A56501682BCB_at_NSTMC703PEX.ubsamericas.net>



Ric  

This looks like a great research project J- but can you share what you are attempting to achieve and why  

  • I assume that you are looking to execute this essentially in SQL plus or PLSQL anonymous block
  • I could be wrong but SQLPLUS though does have a concept of a SQLPATH, it does not have a concept of current directory (pwd) - it just executes the scripts

o So are you then looking to have this directory called as a function dynamically executed for each sql script so that it correctly outputs the directory name from where the script was executed.

One quick thought would be ! echo `pwd` > /tmp/1.result and then read /tmp/1.result in a plsql function

I will need to test  

Thanks and Regards  

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Ric Van Dyke Sent: Wednesday, December 18, 2013 3:48 PM To: oracle-l_at_freelists.org
Subject: Softball (I hope) - Current Directory in SQLPlus  

I thought this would be easy but I'm not figuring it out nor am I able to find it in all my searching.  

I want to create a directory for the current directory. I want to do this programmatically in SQLPlus with or without PL/PQL is fine.  

CREATE OR REPLACE DIRECTORY SQL_FILE_LOCATION AS <current directory here>;  

It doesn't appear to be in SYS_CONTEXT.  

Yes I know I can do a HOST CD in SQLPlus to see the current directory, but how to I put the output of that that into the CREATE command?  

Thanks!  

+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

Ric Van Dyke

Education Director

Hotsos Ltd.  



Please visit our website at
http://financialservicesinc.ubs.com/wealth/E-maildisclaimer.html for important disclosures and information about our e-mail policies. For your protection, please do not transmit orders or instructions by e-mail or include account numbers, Social Security numbers, credit card numbers, passwords, or other personal information.

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Dec 18 2013 - 22:07:55 CET

Original text of this message