reading from files in plsql
I have this snippet of code which reads in, line by line a two field file, seperated by whitespace and assigns the two fields to two different variables (file name gets passed into the procedure).
The in_line is a defined variable (varchar2) which holds the line we are dealing with. the V_StrLength is the length of the line
What I would like to do is change this to read the same two values in from a different format of file. Basically i want to pull out characters 17 to 25 of the file for the v_PBLRec.Account_ID variable and add a 0 to the front of it. Then pull out characters 35 to 44 and strip off any leading 0's and assign that to the v_PBLRec.Prepaid_Credit_Balance variable.
i := instr(in_line,' ',1);
For j in 1..V_StrLength LOOP
IF v_temp<>' ' then
v_PBLRec.Prepaid_Credit_Balance := rtrim(substr(in_line,i));
i := i+1;
IF v_PBLRec.Prepaid_Credit_Balance is null then
IF UTL_FILE.IS_OPEN (File_Handle) THEN
UTL_FILE.PUTF(File_Handle, '%s.Line Skipped.\n',v_ReadCnt);
v_RejOtherCnt := v_RejOtherCnt + 1;
Can anyone help me, as you can see i'm not a pl/sql developer. Just been asked to change some code and im stuck on this one part
Last edited by davey23uk; 01-31-2003 at 04:23 PM.
Click Here to Expand Forum to Full Width