Link to home
Start Free TrialLog in
Avatar of chalie001
chalie001

asked on

space replacing value when importing file using text_io

extra space replacing value when using             text_io am having vdate value replace by space
V_DCN := 	'ZD'||V_MOE_CODE||rpad(nvl(V_DATE,' '),5,' ')||'18'||V_DCN_SERIAL_NO;

Open in new window

i have attch the full code and file
INT.REQ-5605-18340.TXT
sapace12.jpg
Avatar of Franck Pachot
Franck Pachot
Flag of Switzerland image

Hi, I don't think your question is clear enough to get an answer
Avatar of chalie001
chalie001

ASKER

this line must have date its been replace by space after ZDZF
KWAZ01 ZDZF     1816788D05330534                                            0002
this the code
EXTASPACE.txt
I have search your code (EXTASPACE.txt) and problem is caused by variable V_DATE which is only declared but never filled.So  V_DATE is always NULL.
its filled check the code
I have checked the code. V_DATE is only declared in your code so it is always null. Where it is filled ?
I agree with Helena.  V_DATE_DDD  is filled, V_DATE is not.
am geting this file when i put V_DATE_DDD
INT.REQ-14-18351.TXT
EXTASPACE.txt
What is wrong with output ?
this line



KWAZ01 ZDZG351  1812037D03610362                                            0002

shoul be
KWAZ01 ZDZG18051  1812037D03610362                                            0002

like in second line
I have search your code.You always create 'KWAZ' with
V_DCN :=       'ZD'||V_MOE_CODE||rpad(nvl(V_DATE_DDD,' '),5,' ')||'18'||V_DCN_SERIAL_NO;
and
V_DATE_DDD := TO_CHAR(SYSDATE, 'DDD');
so it will always be something like
ZDZG351.

If it ought to be something like ZDZG18051, then, I think, you should change this line
V_DCN :=       'ZD'||V_MOE_CODE||rpad(nvl(V_DATE_DDD,' '),5,' ')||'18'||V_DCN_SERIAL_NO;

Previously it was like this
V_DCN :=       'ZD'||V_MOE_CODE||rpad(nvl(V_DATE,' '),5,' ')||'18'||V_DCN_SERIAL_NO;
but variable v_date was not filled.
so what is it suppose go be
I think that you ought to use
V_DCN :=       'ZD'||V_MOE_CODE||rpad(nvl(V_DATE,' '),5,' ')||'18'||V_DCN_SERIAL_NO;

and fill at the beginning of procedure (or somewhere) variable V_DATE. I don't know how, because i dont know what is 18051.
KWAZ01 ZDZG18051  1812037D03610362                                            0002
That date is today date in julian date that v_date
So you have fill it in your procedure.
select to_char(sysdate,'J') from dual;
but length is 7 not 5.
V_date must be today date in Julian date
This is today in Julian date:
select to_char(sysdate,'J') from dual;
what other date type are there
It's a year and number of days in the year it must be formated
ASKER CERTIFIED SOLUTION
Avatar of Helena Marková
Helena Marková
Flag of Slovakia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial