Home » Developer & Programmer » Precompilers, OCI & OCCI » fwrite (pro*c)
fwrite [message #285364] Tue, 04 December 2007 05:32
contactabu
Messages: 1
Registered: December 2007
Junior Member
Hi,
I'm using bulk write using the fwrite function and i'm writting the charachter array. i am getting fixed lenght written in the output(4000 charachters in every line). my output should be variable length. how to elimate the spaces thru fwrite function. My array width is 4000 and length is 50000. i want the exact lenght of data fetched from table. If i write it by row by row, then its not a plm. it writes the exact data fetched from table.

CHUNK=50000
NAME_LEN=4000;
array_size =50000;

typedef char asciiz[NAME_LEN];
EXEC SQL TYPE asciiz IS STRING(NAME_LEN) REFERENCE;
asciiz data_to_write[CHUNK];
.
.

EXEC SQL FOR :array_size FETCH C into data_to_write;
.
.
fwrite(data_to_write,sizeof(asciiz),sqlca.sqlerrd[2]-last_fetch_count,datFile);

Thanks in advance,
Abu
Previous Topic: Cursor Identifier using a variable
Next Topic: Proc Error on ras.h on AIX
Goto Forum:
  


Current Time: Thu Dec 08 03:56:01 CST 2016

Total time taken to generate the page: 0.17247 seconds