Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2006
    Posts
    3

    Question Unanswered: SQL loader control file help required

    Hello everyone,

    I am a fresh graduate and have a new job, Can you experienced ones help me .

    I have to write an SQL control file so that it omits all the leading zeros from the integer fields.

    looking forward to your guidence.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool



    Easy, just check the manual

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Jul 2003
    Posts
    2,296
    did you read anything about this?
    how far have you gotten?

    did you even TRY to load this as-is?
    leading zeros mean NOTHING to integer/numeric fields.

    000100 = 100
    PHP Code:
    system@dbselect to_number('000100'from dual;

    TO_NUMBER('000100')
    -------------------
                    
    100 
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    And if the number is to be stored in a varchar2 field, then

    SQL> select ltrim('000100','0') from dual;

    LTR
    ---
    100
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool



    Bottom line: Input format does not matter.

    If you have any issues/error when you do write the control file, post a copy (and error messages) and we will be glad to help you debug.

    Good luck!

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  6. #6
    Join Date
    Apr 2006
    Posts
    3

    Thank you

    Thank you everybody, I managed to do it now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •