Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to obtain date variable on NT to scripting export process

Re: How to obtain date variable on NT to scripting export process

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 21 Feb 2000 13:34:43 -0500
Message-ID: <n813bsk1p5791lg1a1qgbivg1fipqioess@4ax.com>


A copy of this was sent to "Marc Brevet Lepreux" <mbrevet_at_free.fr> (if that email address didn't require changing) On Mon, 21 Feb 2000 17:26:23 GMT, you wrote:

>Hello every body,
>I search a procedure to use the system date on NT Oracle server script for
>export oracle.
>It's very easy on Unix but on NT .....(thanks Bill)
>

I'll cheat. I'll show you a way to do this that works in Unix and NT. Instead of trying to force the NT .cmd script language into unnatural acts or tell you to buy a 3'rd party "Unix" shell -- we'll use SQLPlus as our general purpose scripting tool.

Say you have a file, export.cmd, that looks like this:

sqlplus scott/tiger @doexport

---------------- eof ---------------------

the line sqlplus scott/tiger @doexport is in place of

exp userid=scott/tiger ......

the script doexport.sql looks like:

select to_char( sysdate, 'ddmmyyyy' ) today from dual;

host exp userid=scott/tiger tables=emp file=exp_prod_&dt..exp

exit

-------------- eof -------------------------------------


That should work on all platforms.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Feb 21 2000 - 12:34:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US