RE: file random write access from within a database

From: Goulet, Richard <Richard.Goulet_at_parexel.com>
Date: Fri, 11 Mar 2011 12:49:23 -0500
Message-ID: <6B0D50B70F12BD41B5A67F14F5AA887F0F007D45_at_us-bos-mx022.na.pxl.int>



Depending on the Oracle version your using you should be able to do that using an external table with the datapump access method.  

Dick Goulet
Senior Oracle DBA/NA Team Leader  


From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Guillermo Alan Bort Sent: Friday, March 11, 2011 12:18 PM
To: deshpande.subodh_at_gmail.com
Cc: remigiusz.sokolowski_at_nordea.com; oracle-l Subject: Re: file random write access from within a database

You can call an external program and code that in C... it would be platform-dependant or would require recompile if you can code platform agnostic C.

hth
Alan.-

2011/3/11 Subodh Deshpande <deshpande.subodh_at_gmail.com>

        Hi Sokolowski,          

        you have a file that you will upload with utl file and then latter at any point of time, you want to change few contents of the uploaded file. is it so..I do not think its possible..cause this uploaded file becomes a data element of certain object and associated datafile.          

	Quote
	But this is rather unacceptable solution - I would rather imagine I open
	a file, set a position, write few bytes at this position (adding or
	eventually replacing some bytes on specified length), close a file.
	
	UnQuote
	 
	This is what something similar happen in Automated storage managed tablesapces but oracle archicture takes care of it..
	 
	thanks..subodh
	
	2011/3/11 Remigiusz Sokolowski <remigiusz.sokolowski_at_nordea.com> 


		hi,
		
		I wonder if it is possible to write to a file from within a database at
		the chosen position.
		
		What I want to achieve is to modify a kind of header of simple text file
		(few tens of MB in size).
		I could read it to a LOB/table/buffer/whatever, modify few bytes and
		write it back to the file in its entirety.
		But this is rather unacceptable solution - I would rather imagine I open
		a file, set a position, write few bytes at this position (adding or
		eventually replacing some bytes on specified length), close a file.
		
		I tried fseek, but it works in the Read-like mode only, as I get
		ERROR at line 1:
		ORA-29283: invalid file operation
		ORA-06512: at "SYS.UTL_FILE", line 1219
		ORA-06512: at "REMS.WRITE_AT", line 16
		ORA-06512: at line 1
		
		
		Regards
		Remigiusz
		
		--
		Pole nakazi
		
		----------------------------------------------------------------------
		Remigiusz Sokolowski <remigiusz.sokolowski_at_nordea.com>
		pos   : DBA at DIiUSI
		addr  : Nordea Bank Polska SA, Luzycka 6A Street, 81-537 Gdynia, Poland
		phone : +48 58 667 17 43
		mobile: +48 602 42 42 77
		Nordea Bank Polska S.A. z siedzibą w Gdyni, ul. Kielecka 2, 81-303 Gdynia,
		wpisaną do Rejestru Przedsiębiorców Krajowego Rejestru Sądowego pod numerem: 0000021828,
		dla której dokumentację przechowuje Sąd Rejonowy Gdańsk - Północ w Gdańsku,
		VIII Wydział Gospodarczy Krajowego Rejestru Sądowego,
		o kapitale zakładowym i wpłaconym w wysokości: 227.593.500,00 złotych,
		NIP: 586-000-78-20, REGON: 190024711--
		http://www.freelists.org/webpage/oracle-l
		
		
		

	
	
	
	-- 

==============================
DO NOT FORGET TO SMILE TODAY
==============================
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Mar 11 2011 - 11:49:23 CST

Original text of this message