JamesCrawford
MIS
Hi
I am currently using the following procedure on a v6i form to extract data from a block and create a file, everything with this current procedure works fine, however, as is usually the case, my users requirment has now changed to a fixed length file rather than a '#' delimited one. I have tried numerous times to create a fixed length file but with no success, unfortunatley all fields are of variable lengths.
Does anybody have any ideas or suggestions that may point me in the right dircetion.
Cheers
James
--------------------------
PROCEDURE create_file IS
FILENAME VARCHAR2(100);
MYFILE TEXT_IO.FILE_TYPE;
BEGIN
GO_BLOCK ('jc1');
IF :SYSTEM.BLOCK_STATUS != 'NEW' THEN
FIRST_RECORD;
MYFILE := TEXT_IO.FOPEN ('C:\test-'||sysdate||'.TXT', 'W');
LOOP
TEXT_IO.PUT_LINE (MYFILE,
:jc1.id_number||'#'||
:jc1.spec_code ||'#'||
:jc1.spec_desc ||'#'||
:jc1.date||'#'||
:jc1.type ||'#'||
:jc1.surname ||'#'||
:jc1.forenames ||'#'||
:jc1.date_of_birth ||'#'||
:jc1.add1 ||'#'||
:jc1.add2||'#'||
:jc1.add3 ||'#'||
:jc1.town ||'#'||
:jc1.county ||'#'||
:jc1.postcode ||'#'||
:jc1.home_phone ||'#'||
:jc1.work_phone||'#'||
:jc1.mord||'#'||
:jc1.mem_id||'#'||
:jc1.location_id||'#'||
:jc1.v||'#'||
:jc1.u);
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
END loop;
END if;
TEXT_IO.PUT_LINE (MYFILE,'END OF FILE');
message ('Data Exported for'||sysdate);
TEXT_IO.FCLOSE(MYFILE);
END;
---------------------------------
I am currently using the following procedure on a v6i form to extract data from a block and create a file, everything with this current procedure works fine, however, as is usually the case, my users requirment has now changed to a fixed length file rather than a '#' delimited one. I have tried numerous times to create a fixed length file but with no success, unfortunatley all fields are of variable lengths.
Does anybody have any ideas or suggestions that may point me in the right dircetion.
Cheers
James
--------------------------
PROCEDURE create_file IS
FILENAME VARCHAR2(100);
MYFILE TEXT_IO.FILE_TYPE;
BEGIN
GO_BLOCK ('jc1');
IF :SYSTEM.BLOCK_STATUS != 'NEW' THEN
FIRST_RECORD;
MYFILE := TEXT_IO.FOPEN ('C:\test-'||sysdate||'.TXT', 'W');
LOOP
TEXT_IO.PUT_LINE (MYFILE,
:jc1.id_number||'#'||
:jc1.spec_code ||'#'||
:jc1.spec_desc ||'#'||
:jc1.date||'#'||
:jc1.type ||'#'||
:jc1.surname ||'#'||
:jc1.forenames ||'#'||
:jc1.date_of_birth ||'#'||
:jc1.add1 ||'#'||
:jc1.add2||'#'||
:jc1.add3 ||'#'||
:jc1.town ||'#'||
:jc1.county ||'#'||
:jc1.postcode ||'#'||
:jc1.home_phone ||'#'||
:jc1.work_phone||'#'||
:jc1.mord||'#'||
:jc1.mem_id||'#'||
:jc1.location_id||'#'||
:jc1.v||'#'||
:jc1.u);
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
END loop;
END if;
TEXT_IO.PUT_LINE (MYFILE,'END OF FILE');
message ('Data Exported for'||sysdate);
TEXT_IO.FCLOSE(MYFILE);
END;
---------------------------------