RE: how to pick the lastes file using UTL_FILE package ?

2002-05-28 Thread Richard Huntley
Title: RE: how to pick the lastes file using UTL_FILE package ?





Rahul, here is how you'd do it on a Unix box: ls -t|line
ls -t would give you a list of files most recent first, then the line command would give
you back the first filename only.  In 2K the first part of that is DIR /O:-D, not sure how you
get just the first filename from the list (the latest file will be first), but you could redirect
that command to a file then read the first filename from the file! (DIR /O:-D > files)


HTH,
Rich


-Original Message-
From: Rahul [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 2:18 AM
To: Multiple recipients of list ORACLE-L
Subject: how to pick the lastes file using UTL_FILE package ?



list,  the requirement is to use the UTL_FILE package on the server side to
open and process the files as they are created (each hour) in a server's
directory !!
could anyone suggest a logic to pick up the the lastest file created in that
dir. ? 


TIA


8.1.6 on win2k



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rahul
  INET: [EMAIL PROTECTED]


Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California    -- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).





RE: how to pick the lastes file using UTL_FILE package ?

2002-05-27 Thread Disser, Arno

Well,

in that case use loader to process the file into a tmptable, and
forget UTL_FILE.

aRNO

-Original Message-
[mailto:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 6:08 PM
To: Multiple recipients of list ORACLE-L



Rahul,

This isn't exactly what you're asking but,

If OEM is set up:
You can use the intelligent agent on   win2k.
Write a script  that identifies the file and then calls the PL/SQL
procedure.
Schedule the job in OEM.

Chaim





Rahul <[EMAIL PROTECTED]>@fatcity.com on 05/27/2002 02:18:18 AM

Please respond to [EMAIL PROTECTED]

Sent by:[EMAIL PROTECTED]


To:Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
cc:



list,  the requirement is to use the UTL_FILE package on the server side to
open and process the files as they are created (each hour) in a server's
directory !!
could anyone suggest a logic to pick up the the lastest file created in
that
dir. ?

TIA

8.1.6 on win2k


--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Rahul
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Disser, Arno
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



Re: how to pick the lastes file using UTL_FILE package ?

2002-05-27 Thread Chaim . Katz


Rahul,

This isn't exactly what you're asking but,

If OEM is set up:
You can use the intelligent agent on   win2k.
Write a script  that identifies the file and then calls the PL/SQL
procedure.
Schedule the job in OEM.

Chaim





Rahul <[EMAIL PROTECTED]>@fatcity.com on 05/27/2002 02:18:18 AM

Please respond to [EMAIL PROTECTED]

Sent by:[EMAIL PROTECTED]


To:Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
cc:



list,  the requirement is to use the UTL_FILE package on the server side to
open and process the files as they are created (each hour) in a server's
directory !!
could anyone suggest a logic to pick up the the lastest file created in
that
dir. ?

TIA

8.1.6 on win2k


--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Rahul
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



RE: how to pick the lastes file using UTL_FILE package ?

2002-05-27 Thread DENNIS WILLIAMS

Rahul - Just a thought here. This would be a simple task in Unix. One idea
would be to take a look at the Unix/Posix type interface packages. Another
thought would be to ask this question on a W2K forum.
Dennis Williams
DBA
Lifetouch, Inc.
[EMAIL PROTECTED]


-Original Message-
Sent: Monday, May 27, 2002 1:18 AM
To: Multiple recipients of list ORACLE-L


list,  the requirement is to use the UTL_FILE package on the server side to
open and process the files as they are created (each hour) in a server's
directory !!
could anyone suggest a logic to pick up the the lastest file created in that
dir. ? 

TIA

8.1.6 on win2k


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rahul
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: DENNIS WILLIAMS
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



RE: how to pick the lastes file using UTL_FILE package ?

2002-05-27 Thread Ganesh Raja

1. Run a Cron Job that every Hour Runs the Ls command with the necessary
switches to sort the file listing by the date and redirect the filename to a
Flat file.
2. Run a Job In Oracle that will open that particular file and read the
contents of that file and open the file mentioned therein.


There are always other ways to achieve this by means of a Java Stored Proc
running inside Oracle without a Cron Job. You can search for Executing
external Commands inside a Procedure in http://asktom.oracle.com [Which I
blv is down today]

HTH

Best Regards,
Ganesh R
Tel  : +971 (4)  397 3337  Ext 420
Fax  : +971 (4)  397 6262
HP   : +971 (50) 745 6019

Live to learn... forget... and learn again. 




-Original Message-
Sent: Monday, May 27, 2002 10:18 AM
To: Multiple recipients of list ORACLE-L


list,  the requirement is to use the UTL_FILE package on the server side to
open and process the files as they are created (each hour) in a server's
directory !! could anyone suggest a logic to pick up the the lastest file
created in that dir. ? 

TIA

8.1.6 on win2k


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rahul
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB ORACLE-L (or the name of
mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Ganesh Raja
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



RE: how to pick the lastes file using UTL_FILE package ?

2002-05-27 Thread Stephane Faroult



>- Original Message -
>From: Rahul <[EMAIL PROTECTED]>
>To: Multiple recipients of list ORACLE-L
><[EMAIL PROTECTED]>
>Sent: Sun, 26 May 2002 22:18:18
>
>list,  the requirement is to use the UTL_FILE
>package on the server side to
>open and process the files as they are created
>(each hour) in a server's
>directory !!
>could anyone suggest a logic to pick up the the
>lastest file created in that
>dir. ? 
>
>TIA
>
>8.1.6 on win2k
>

The best solution I can think of is to make the filename predictable - if it contains 
some time of timestamp (eg YYMMDDHH24) the Oracle side can deduce in advance from 
SYSDATE which file it must open. Short of that, you can have a 'utility' file in which 
some procedure keeps track of the latest file - Read it first, then open the actual 
data file.

Regards,

Stephane Faroult
Oriole
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephane Faroul
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



how to pick the lastes file using UTL_FILE package ?

2002-05-26 Thread Rahul

list,  the requirement is to use the UTL_FILE package on the server side to
open and process the files as they are created (each hour) in a server's
directory !!
could anyone suggest a logic to pick up the the lastest file created in that
dir. ? 

TIA

8.1.6 on win2k


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rahul
  INET: [EMAIL PROTECTED]

Fat City Network Services-- (858) 538-5051  FAX: (858) 538-5051
San Diego, California-- Public Internet access / Mailing Lists

To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).