Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Leading zero is removed from Oracle Forms when data is uploaded through excel sheet.

bootstrapJan 20 2020 — edited Jan 21 2020

Oracle Forms app contains Excel upload button. For some columns data in the excel contains leading 0. When the data is uploaded in Oracle Forms those leading zero are automatically removed from the form. Please suggest.

Please find below pl/sql code.

DECLARE

r number; --Row

c number; -- Column

i number:=0;

buffer VARCHAR2(5000);

frst_item VARCHAR2(5000);

curr_item VARCHAR2(5000);

buf_val VARCHAR2(5000);

buf_val1 VARCHAR2(5000);

ln_chk Number default 0;

ln_chk1 Number default 0;

ln_seq Number default 0;

ls_coil_id VARCHAR2(15);

ln_ra VARCHAR2(500);

ls_err VARCHAR2(500);

lv_file2 TEXT_IO.FILE_TYPE;

BEGIN

--MESSAGE('25-09-2018');

--MESSAGE('25-09-2018');

p_client_appl.P_INVOKE_QUIT_EXCEL(:BOO_CONTROL.NBT_FILE, 1);

GO_BLOCK('boo_cold_coil');

FIRST_RECORD;

r:=1;

c:=1;

LOOP

c:=1;

p_client_appl.get_cell_obj(r, c);

buf_val := CLIENT_OLE2.get_char_property(p_client_appl.cell,'Value');

MESSAGE(buf_val);

                           

IF buf_val = 'null' THEN

EXIT;

END IF;

BEGIN

:BOO_COLD_COIL.NBT_CCL_ID_COIL := trunc(buf_val);

EXCEPTION

WHEN OTHERS THEN

:BOO_COLD_COIL.NBT_CCL_ID_COIL := buf_val;

END;

   

--select to_char(buf_val)

--into :BOO_COLD_COIL.NBT_CCL_ID_COIL from dual;                                  

EXIT WHEN buf_val IS NULL ;

i:= i+1; 

r:=r+1;

next_record;

END LOOP;

FIRST_RECORD;

p_client_appl.P_INVOKE_QUIT_EXCEL(:BOO_CONTROL.NBT_FILE, 0);

set_application_property(cursor_style, 'default');

EXCEPTION

WHEN OTHERS THEN

  --  DDE.APP_END(AppID);

    SET_APPLICATION_PROPERTY(CURSOR_STYLE,'DEFAULT');

  MESSAGE(SQLERRM||ls_err);

  MESSAGE(SQLERRM||ls_err);

END;

FIRST_RECORD;

Comments
Post Details
Added on Jan 20 2020
3 comments
1,000 views