Skip to Main Content

SQL & PL/SQL

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!

TO_NUMBER(col, '9999999d99')

Sandy310May 6 2010 — edited May 7 2010
Hi,

I am looking for following values. ex: instead of 500.00 im getting 500 . I have tried TO_NUMBER(v_earningbasisamount, '9999999d99') format but no luck.
v_earningbasisamount
39.50
500.00
but i get
v_earningbasisamount
39.50
500
I am working on Oracle 11g. most of the code is removed to make code readable.
create or replace
PROCEDURE PRC_FILE_LOAD(
    p_in_file_name IN VARCHAR2,
    p_out_message OUT VARCHAR2)
IS
  variable
  v_earningbasisamount NUMBER(9,2);
  
  CURSOR cur_accural_staging (cp_in_fileid IN VARCHAR2)
  IS
    SELECT * FROM whr_stageftd WHERE FILEID = cp_in_fileid;
BEGIN
   
  --open files
  v_file_handler := UTL_FILE.FOPEN(v_file_path, v_file_name, 'r');
  
  LOOP

      BEGIN
        UTL_FILE.GET_LINE(v_file_handler, v_text);
      EXCEPTION
      WHEN no_data_found THEN
        EXIT; -- end of file
      END;
      -------------------- Insert data in to whr_stageftd table -------------------------------
      
	  v_partnerid                  :=FNC_PIPE_PARSE (V_TEXT,13,'~');
	  v_addressline1               :=FNC_PIPE_PARSE (V_TEXT,14,'~');
	  v_transactioncode            :=FNC_PIPE_PARSE (V_TEXT,15,'~');
	  v_earningbasisamount         :=FNC_PIPE_PARSE (V_TEXT,16,'~');
	  v_transdesc                  :=FNC_PIPE_PARSE (V_TEXT,17,'~');
	 
        
          INSERT
        INTO whr_stageftd
          ( transactioncode ,
            earningbasisamount,
            transactiondescription ,
                      )
          VALUES
          (
            v_transactioncode ,
        --- v_earningbasisamount ,
           TO_NUMBER(v_earningbasisamount, '9999999d99'),
            v_transdesc ,
                      );
            END IF;
    
  END LOOP;
   COMMIT;
  UTL_FILE.FCLOSE(v_file_handler);
  END PRC_FTD_FILE_LOAD;
  
thanks
sandy
This post has been answered by John Spencer on May 7 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2010
Added on May 6 2010
7 comments
2,297 views