Home » Developer & Programmer » Forms » load a text-file without using a DB
load a text-file without using a DB [message #81928] Wed, 02 April 2003 06:12 Go to next message
Marco D'Onofrio
Messages: 1
Registered: April 2003
Junior Member
how can i load a text-file into a form text-item without using a db?
Re: load a text-file without using a DB [message #81938 is a reply to message #81928] Wed, 02 April 2003 23:14 Go to previous messageGo to next message
utsav
Messages: 94
Registered: March 2003
Member
Hi,
I am unable to get u r problem.

utsav.
Re: load a text-file without using a DB [message #81981 is a reply to message #81928] Mon, 07 April 2003 08:21 Go to previous messageGo to next message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
U can use Text_IO pkg with Read option.
Re: load a text-file without using a DB [message #82000 is a reply to message #81928] Tue, 08 April 2003 10:18 Go to previous message
shadow
Messages: 15
Registered: April 2003
Junior Member
PROCEDURE FILTER IS
in_file TEXT_IO.FILE_TYPE;
your_file VARCHAR2(50) := 'C:RAPORLAMATEMPBEKLEYEN.TXT';
text_line VARCHAR2(400);
MUSTERI VARCHAR2(100);
LOKASYON VARCHAR2(15);
i number :=0;
CUST_ID NUMBER;
BEGIN
--ERASE(:GLOBAL.COUNTER);
IF :BEKSIP.MUSTERI IS NOT NULL THEN
MUSTERI :=:BEKSIP.MUSTERI;
LOKASYON :=:BEKSIP.LOCATION;
ELSE
in_file := TEXT_IO.FOPEN(your_file, 'r');
TEXT_IO.GET_LINE(in_file, text_line);
MUSTERI :=RTRIM(SUBSTR(TEXT_LINE,169,60));
--
CUST_ID := CUSTOMER_ID(MUSTERI);
--CREATE_LOC_LOV (CUST_ID);
LOKASYON :=RTRIM(SUBSTR(TEXT_LINE,362,15));
TEXT_IO.FCLOSE(in_file);
END IF;
in_file := TEXT_IO.FOPEN(your_file, 'r');
GO_BLOCK('BEKSIP');
CLEAR_BLOCK();
MESSAGE(MUSTERI);
--MESSAGE(LOKASYON);
LOOP
TEXT_IO.GET_LINE(in_file, text_line);
IF MUSTERI = RTRIM(SUBSTR(TEXT_LINE,169,60)) THEN-- AND LOKASYON =RTRIM(SUBSTR(TEXT_LINE,362,15)) THEN
i:=i+1;
MESSAGE(I);
:BEKSIP.IL:=SUBSTR(TEXT_LINE,1,18);
:BEKSIP.BOLGE:=SUBSTR(TEXT_LINE,20,20);
:BEKSIP.SATIS_TEMSILCISI:=SUBSTR(TEXT_LINE,41,5);
:BEKSIP.URUN_KODU:=SUBSTR(TEXT_LINE,47,20);
:BEKSIP.URUN_ADI:=SUBSTR(TEXT_LINE,68,100);
:BEKSIP.MUSTERI:=SUBSTR(TEXT_LINE,169,60);
:BEKSIP.TARIH:=SUBSTR(TEXT_LINE,230,12);
:BEKSIP.SIP_MIKTARI:=SUBSTR(TEXT_LINE,243,12);
:BEKSIP.BEKLEYEN:=SUBSTR(TEXT_LINE,256,12);
:BEKSIP.BEK_TUT:=SUBSTR(TEXT_LINE,269,12);
:BEKSIP.DEPO:=SUBSTR(TEXT_LINE,282,5);
:BEKSIP.ANLASMA:=SUBSTR(TEXT_LINE,288,15);
:BEKSIP.SIP_NO:=SUBSTR(TEXT_LINE,304,12);
:BEKSIP.FATURALANAN:=SUBSTR(TEXT_LINE,317,12);
:BEKSIP.YUKLENEN:=SUBSTR(TEXT_LINE,330,12);
:BEKSIP.SIP_TUT:=TO_NUMBER(SUBSTR(TEXT_LINE,343,18));
:BEKSIP.LOCATION:=SUBSTR(TEXT_LINE,362,15);
NEXT_RECORD;
END IF;
END LOOP;
TEXT_IO.FCLOSE(in_file);
EXCEPTION
WHEN NO_DATA_FOUND THEN
TEXT_IO.FCLOSE(in_file);
FIRST_RECORD;
:global.counter:=i;

END;
Previous Topic: Problem with return value of a stored function
Next Topic: Play Flash file or avi file in OCX
Goto Forum:
  


Current Time: Wed Apr 24 12:37:07 CDT 2024