Home » SQL & PL/SQL » SQL & PL/SQL » File Line Count (Oracle 10g)
File Line Count [message #342378] Fri, 22 August 2008 03:35 Go to next message
srivaths
Messages: 60
Registered: June 2005
Location: France
Member

Hi,

I am working with UTL_FILE for reading flat file processing. I would like to check the footer record first before I start processing.

Will it be better to do in Unix level or Is there a function in Oracle UTL_FILE or any system function which could get me the footer line without reading the entire file.

Thanks
Srivaths
Re: File Line Count [message #342385 is a reply to message #342378] Fri, 22 August 2008 04:02 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There is no function in UTL_FILE, do it at OS level.

Regards
Michel
Re: File Line Count [message #342394 is a reply to message #342385] Fri, 22 August 2008 04:15 Go to previous messageGo to next message
srivaths
Messages: 60
Registered: June 2005
Location: France
Member

Is there any function inside oracle similar to UTL_FILE which could directly goto last line of the flat file present in the file system without reading/traversing each line in the file?

like tail -1 <<filename>> in unix
Re: File Line Count [message #342406 is a reply to message #342394] Fri, 22 August 2008 04:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
No, there is none.
Remember that Oracle is for managing data not files.

Regards
Michel
Re: File Line Count [message #342407 is a reply to message #342394] Fri, 22 August 2008 04:56 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Oracle is primarily a relational database, not a file handling system. As such, it's a little light on file handling commands.

If you know the byte offset in the file that you need to go to, you can use Utl_File.Fseek to move the read position to that point, but that's about it.
Re: File Line Count [message #342412 is a reply to message #342407] Fri, 22 August 2008 04:59 Go to previous message
srivaths
Messages: 60
Registered: June 2005
Location: France
Member

Thanks for your comments. I would do it in shell level itself.

Regards
Srivaths
Previous Topic: Utl Mail
Next Topic: Join query -- Is there a better way?
Goto Forum:
  


Current Time: Sun Dec 11 02:40:57 CST 2016

Total time taken to generate the page: 0.23491 seconds