Home » Developer & Programmer » Forms » get count of line from Client_Text_Io.Get_Line (FORM 10G, Windows)
get count of line from Client_Text_Io.Get_Line [message #547591] Wed, 14 March 2012 23:23 Go to next message
lie_susanlih
Messages: 1
Registered: March 2012
Location: Indonesia
Junior Member
Dear all,

Could you tell me how to get the count from Client_Text_Io.Get_Line??

For Example :
Client_Text_Io.Get_Line(vOutFile,voutput);
vBaris := voutput + 1;
If vBaris = 3 then
v_reg := SUBSTR (voutput, 1, 3);
tanggal := SUBSTR (voutput,1, 4);
v_outlet := SUBSTR (voutput, INSTR (voutput, ',', 4) + 1, 3);
v_refer := SUBSTR (voutput, INSTR (voutput, ',', 6) + 1, 4);
etc...

so when VBaris loop
that can be
vbaris=1
vbaris=2
vbaris=3 --> execute the voutput..


[EDITED by LF: merged topics, merged messages]

[Updated on: Thu, 15 March 2012 01:04] by Moderator

Report message to a moderator

Re: get count of line from Client_Text_Io.Get_Line [message #547644 is a reply to message #547591] Thu, 15 March 2012 06:28 Go to previous message
owais_baba
Messages: 289
Registered: March 2008
Location: MUSCAT
Senior Member
if you ask about the code we are using the following code:

DELETE FROM tableName;
in_file := client_text_io.fopen(:file_path,'r');
        loop
           V_LINE_COUNT := V_LINE_COUNT + 1;
   begin
           client_text_io.get_line(in_file,linebuf);
exception
           when no_data_found then
   IF V_LINE_COUNT = 1 THEN
           MESSAGE('empty file');
           RAISE FORM_TRIGGER_FAILURE;
    END IF;
        exit;
end;
           V_var1 := nvl(substr(linebuf,1 ,10 ),0);
           V_var2 := nvl(substr(linebuf,12 ,2 ),0);
           V_var3 := substr(linebuf,15 ,10 );
           V_var3 :=trim(V_var3);
    IF V_var3 = '' THEN
           V_var4 :='';
       else 
           V_var4 := TO_NUMBER(V_var3) ;
    end if; 
           V_var5 := substr(linebuf,26 ,70 );

    INSERT INTO tableName VALUES (V_var1,V_var2,V_var4,V_var5);

client_text_io.new_line;
<<end_loop>> 
null;
end loop; 



it could help u

baba Cool


Previous Topic: Ref Cusor
Next Topic: How to open a URL from oracle forms ?
Goto Forum:
  


Current Time: Sat Jul 06 00:04:19 CDT 2024