Home » SQL & PL/SQL » SQL & PL/SQL » create a text file and write data (merged)
create a text file and write data (merged) [message #256311] Fri, 03 August 2007 15:00 Go to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
it has to write data from start position 1 to the end postion 1300.

when i open a text file, it does not write proper way.
it makes two rows: 1-1200 and 1 - 100

Based on the code there is no logic to create another row after 1201.

Why does it make two row??
Re: wirte data [message #256315 is a reply to message #256311] Fri, 03 August 2007 15:11 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I think you should have a look at non-english forums if you can't pick one of your native language as what you post is "ununderstandable".

Is this an Oracle question?

Regards
Michel
create a text file and wirte data [message #257109 is a reply to message #256311] Tue, 07 August 2007 10:41 Go to previous messageGo to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
I have a code to create a text file and write data.
total position in text file is 1300. it writes data into the text file based on id.
each id must have one row...
My problem is when the position number in text file comes 1204, it writes data on next row in the text file.

I do not know why it writes on next row when the position number comes 1204..

I use the bottom code to write data into text file...
utl_file.put_line(w, RPAD(NVL(number,' '), 9) || .................);
Re: create a text file and wirte data [message #257112 is a reply to message #257109] Tue, 07 August 2007 10:45 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Default buffer size is 1024 (not 1204).
If you need greater line you have to specify it on fopen call (max. 32K).

Regards
Michel
Re: create a text file and wirte data [message #257117 is a reply to message #257109] Tue, 07 August 2007 10:48 Go to previous messageGo to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
fopen('test','testtext.txt','a',1290);

this is what i have...

if i want to 32 k...how can i change?
Re: create a text file and wirte data [message #257119 is a reply to message #257117] Tue, 07 August 2007 10:54 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Change 1290 to 32767

Regards
Michel
Re: create a text file and wirte data [message #257124 is a reply to message #257109] Tue, 07 August 2007 11:05 Go to previous messageGo to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
chagend that number, but it still creates next row..
Re: create a text file and wirte data [message #257128 is a reply to message #257124] Tue, 07 August 2007 11:11 Go to previous messageGo to next message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Are you sure this is not the way you display or look at it that makes it on 2 lines?

Regards
Michel
Re: create a text file and wirte data [message #257132 is a reply to message #257109] Tue, 07 August 2007 11:16 Go to previous messageGo to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
it writes until 1203 line...
next line starts with 1204, but it writes on next line at first line
Re: create a text file and wirte data [message #257141 is a reply to message #257109] Tue, 07 August 2007 11:30 Go to previous messageGo to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
there is no logic or code to create next line when it comes that number..
Re: create a text file and wirte data [message #257152 is a reply to message #257141] Tue, 07 August 2007 11:57 Go to previous message
Michel Cadot
Messages: 64111
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Post the code otherwise You're On Your Own.

Not all the code only the relevant part that allows you to reproduce your problem.

Regards
Michel

[Updated on: Tue, 07 August 2007 11:58]

Report message to a moderator

Previous Topic: PL/SQL function (merged)
Next Topic: Decimal to Hex conversion of function?
Goto Forum:
  


Current Time: Mon Dec 05 14:50:21 CST 2016

Total time taken to generate the page: 0.07984 seconds