Home » Developer & Programmer » Forms » Excluding last comma
Excluding last comma [message #428843] Fri, 30 October 2009 05:35 Go to next message
sumedh7
Messages: 31
Registered: March 2007
Location: Pune,India
Member
Hi,

I'm trying to upload a file from txt file into table from oracle forms (10g), I'm using following
-------------------------------------------------------

TEXT_IO.GET_LINE(V_OUTFILE,V_LINEREAD );
V_LINE:= V_LINEREAD ;
V_EMP_CODE := TRIM(CHR(9) FROM SUBSTR(V_LINE,1,INSTR(V_LINE,',',1)-1));

V_CARD_NO := TRIM(CHR(9) FROM SUBSTR(V_LINE,INSTR(V_LINE,',',1,1)+1,-(INSTR(V_LINE,',',1,1)+1 -INSTR(V_LINE,',',1,2))));

after this it inserts data into table successfully, now problem is that to upload file i've to put comma (,)to last value for Ex

EMP_CODE CARD_NO
554,55454587,
556,55785687,

I tried this also

V_EMP_CODE := TRIM(CHR(9) FROM SUBSTR(V_LINE,1));
but it gets merged with card_no (554,55454587) in same coulmn.

Please advice how i exclude last comma?

Thanx in advance
Re: Excluding last comma [message #428845 is a reply to message #428843] Fri, 30 October 2009 05:39 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
select rtrim('avadsvsd,adssadf,',',') from dual;

select CHR(9) from dual;
Can you tell me why did you use CHR(9)?

By
Vamsi
Re: Excluding last comma [message #428856 is a reply to message #428845] Fri, 30 October 2009 06:11 Go to previous message
sumedh7
Messages: 31
Registered: March 2007
Location: Pune,India
Member
Hello Sir,

There are two columns in tables in which these two values are inserted, To reading next line CHR(9)is used.
Previous Topic: Looping data block without showing from....
Next Topic: Sending mail automatically from Oracle Form 6i
Goto Forum:
  


Current Time: Fri Sep 20 09:48:14 CDT 2024