TO_NUMBER Function Issue

Hi guys,
would like to ask on what cases would a query return an invalid number error? I know if the column has special characters and letters it would return an invalid number when you use to_number function but I currently have a scenario wherein I have whole numbers in a varchar column but i still get invalid number error.
the data that i'm trying to convert to number was from a csv file. When i first loaded the csv data into the oracle external table , it returned an invalid number error. So, what i did was change the data type of the external table into varchar so that it will load the data.
Now what i want to do is transfer the data from external table to a dimensional table. Since the data type in dimensional table is Number , i have to use to_number function to be able to insert the data. I already tried to use to_number(to_char(trim(columnA))) but still wouldn't work.
Any idea? Appreciate your help.
Thanks.

977487 wrote:
I checked the csv file through unix and found that there is a control M in Col2. Believe that's what causes the invalid number error.
You guys are awesome. Thank you very much!Was this data - the .csv file - moved between a *nix and a Windows platform?  If so, which direction?
*nix and Windows use a different standard to indicate "end of record".  When moving text files between platforms, you have to take that into account.  If moving the file with ftp, you have to indicate it is a 'text' or 'ascii' transfer.  If you forget, then after the fact you can use the 'dos2unix' or 'unix2dos' utility to fix the file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to override to_number function?!

    Hi,
    I already tried to find an answer by searching this forum but without success...
    My problem is, that I have a lot of mappings using the to_number() function to convert char into number. Now it turns out, that in some cases - due to the bad data qualtity - fields contain special chars e.g. 1234" Don't ask why ;) Of course the reguIar tu_number() function fails on that. Now I wrote a to_number function that handles the issue by removing all the special chars and then convert. I now want to override oracle's built-in to_number function with my own function.
    Do you have any ideas how that works? As a requirement the solution should be simple... It would be an imense work to edit every mapping. I global solution is preferred. Something like a priority option, to take self written functions first or sth...
    Thanks for any help!
    Cheers Steffen

    Hi,
    you could use OMB to change all occurance of that functino in your project.
    Unfortunately I know OWB allmost only from theory :-( but I remember, that you can set a context to a project or a mapping and all subsequent operations will happen within that horizont.
    As far as I saw, OMB isn't to hard to use, even without days of learning, just by looking for fitting operation, but I know documentation about OMB is pretty poor, almost only syntax reference is available.
    really overriding the pre_build to_number-function might be possible as sys, but I would avoid that or only do in a relly play-instance. I suppose you tried allready simply to run 'create or replace ...' ?
    Thanks for your tip about number checking, but I tried allready many variations functions like that. I never can get it validated:
    I have a function is_number_num, returning 1 for ok, 0 for false, which si working fine on SQL*PLUS, but when I use it splitter-condition, in this variations:
    "IS_NUMBER_NUM"( GRP_IN.ANZAHL,'NLS_NUMERIC_CHARACTERS='',.''') = 1
    I get: PLS-00801 internal error [phdxcsql_canonicalize_sql:state]
    with .... == 1
    I get:
    Line 0, Col 0:
    The expression is not properly formed.
    I have no bloody idea, what that means and what might be wrong in here ? Even google does not return 1 singel page for the error-parameter !
    I tried several versions:
    "IS_NUMBER_NUM"( GRP_IN.ANZAHL,'NLS_NUMERIC_CHARACTERS='',.''') = 1
    also this: "IS_NUMBER_NUM"( GRP_IN.ANZAHL) = 1
    but nothing is accepted !
    Also I made a more easy function for checking for date-format, which works fine in SQL*PLUS, but can't be validated in OWB-splitter.
    Oracle support is playing for time since days !
    thsi function brings same error, depending if I use 1 or 2 "=" !???
    any idea ?
    somehow I have the feeling, I missed 1 easy rule on how to use a splitter-condition correctly ?
    But I can't see anything wrong in my constructions, especially because they are working fine in SQL*PLUS !???
    thanks for any hint, LaoDe

  • To_number function return Invalid number

    Dear All,
    We have problem recently regarding one of our query that using to_number function. It worked smoothly for 4-5 years until recently our client complaints that the query is returning error ORA-01722: invalid number.
    This is the SQL Script -> SELECT * FROM <table_name> WHERE to_number(b) between :param1 and :param2;
    * Column b is defined as VARCHAR2(20)
    First thing that come to my mind is this error is due to invalid value entered by user. Using the solutions provided by users in this forum and internet, I created SQL a function that checks whether the value is numeric or not.
    So, when I run the query (+SELECT b from <table_name> WHERE is_numeric(b) = 0 AND ROWNUM < 20+) this is the result that I get.
    b
    251567
    251568
    251569
    251570
    251571
    (Up to 11 record; value from 251567 - 251577)
    Is there any limitation on the maximum value that can be converted using to_number* function?*
    I have search the solutions over the internet and I accept the solution/recommendation that we should not store numeric value on varchar/char column; but I hope somebody can explain why I can't use to_number to convert the above figures to numeric, because when I execute SELECT to_number('251567') FROM DUAL it doesn't returned any error)
    Thank you in advance for any help or clarification on this issue.
    Edited by: user5535734 on Apr 16, 2012 10:46 PM

    Funny answer, Billy!
    Sounds like: The world is evil, so you have 3 choices:
    1. Implement a good world
    2. Be a bad guy, too
    3. Live with that bad world and its consequences
    I guess, 930427 only asked for some protection...
    If one has to deal with two external system to move data from one to another - you can't change either of these systems (1 or 2) and you can't afford to fail (3).
    Sometimes blanks inside the numeric values are the reason for INVALID NUMBER, i.e. "123 456".
    as simple
    to_number(replace(VALUE_CHAR, ' ', NULL))
    may help...

  • To_number function doesn't work with apex_collections in where clause

    One of my applications I have been using apex_collections and to_number function
    in the where clause. Since we upgraded apex to version 3.0.1 , it gives the invalid number error.
    Is this a bug in the new Version.
    I had to re-write the logic to fix the application.

    Can you show us that code? An example on apex.oracle.com where we can see the error would be great.
    Scott
    P.S. Please tell us your first name and put it into your handle and/or profile to help us.

  • Function issue of Cross-Reference

    Hi,
    thanks for your attention on this topic.
    there is function issue of Cross-Reference.
    when click the Cross-Reference after re-installed the software (adobe Framemaker 7.10), the function is not working. please kindly check the screenshots below:
    Error message below:
    Please help to check this issue.
    software: Adobe Framemaker 7.10
    System: windows xp sp3
    thanks in advance for your support .
    Message was edited by: Lu Steven

    Fire the error log off to the e-mail address indicated in the error message and then contact Adobe Support.

  • To_Number function is changing decimal places????

    Hi all..I have a number 11,308,861.09
    To sum up with another..I have to use to_number function
    When I am using this function, I am viewing that as 1.13088610859
    Please help....

    Okay.....I tried with seperate sample xml after reading you post....
    This number looked good.
    But in the original template this still showed the same way with incoreect decimals.
    then.. I tried this:
    xdoxslt:to_number(number(ELEMENT))
    This worked.

  • TO_Number Function showing wrong values

    Hi All,
              I am passing a Char value from oracle forms to oracle reports as parameter.
    In Report Query I'm converting the char value into number for comparison using TO_NUMBER() function. As the char value is large value like '001002004006004' it is converting to something like 1.2e+12 and my query results goes wrong. I want value, something like 1002004006004( as initial 00 will be removed).
    I'm using Oracle forms 10g and Reports 10g
    Can anyone please help me.
    Thanks
    Sandeep
    ----Don't think outside the box, Think as if there is no Box at all.

    Hi, Sandeep,
    Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements) that shows what the problem is, and the correct results you want from that sample data.  Explain how you get those results from that data.
    See the forum FAQ: https://forums.oracle.com/message/9362002#9362002
    Don't confuse how a number is displayed with what that number is.  SQL*Plus (and other front ends), by default, allows only 10 character spaces for displaying NUMBERs.  If you have a NUMBER that doesn't fit into 10 spaces, then SQL*Plus will round the digits after the decimal point.  If it still doesn't fit (which is the case with 1002004006004) then SQL*Plus will use scientific notation, rounding the decimal places.  The actual value (at least 38 significant digits) will be used in all computations, regardless of how the NUMBER is displayed.  I doubt if what you posted has anything to do with the real problem.

  • Functional Issues w/ IOS7

    Depending on how this discussion board works, I will attempt to update functional issues with this operating system.
    9/21/13: Alarm:  Setting the alarm is rather akward, the numbers are too rigid, fine, and small.  I feel the numbers being larger would be more user friendly.
    9/21/13 Calendar:  Previous version was superior in certain ways.  Shading out a part of the day which you typically don't use (ex:  1am-5:30am) would be great.  I feel lost in this update, it does not feel refined.  Please allow me to send an appointment through imessage already as well!

    Tell Apple.
    http://www.apple.com/feedback/iphone.html

  • Forum for functional issue

    Hi All!
    Is there any forum related to functional issues in SD and MM.Please do forward me the names if there are any.
    Regards
    Pavan

    Check these
    http://www.sapfans.com/
    http://www.erpfans.com/
    http://www.sap.com/community/default.epx?logonStatusCheck=0 (Login required)
    Regards,
    Vikas Madaan

  • SGD 4.5 Desktop Functionality Issue

    I've come across an odd functionality issue on SGD 4.5. When I start "My Desktop" everything works fine. However if I start a new Full JDS Desktop session on another server, the JDS session doesn't appear to load correctly. New windows automatically open in the upper left corner and can't be moved. If I close both JDS Desktop sessions and open the other system first, then "My Desktop" session doesn't open windows properly. Has anyone come across this? It's not to big of deal right now, but it might become more of an issue when more users start using our SGD instance.
    Adam

    @JRoesler :
    The script for installing the users during installation when the users are not created is included some version before the 4.50.907
    The SGD version here is only 1 minor version before the latest release.
    @aspenhedge:
    If I look into the rpm (for Linux install) I don't see a check for a valid shell. It does however try to 'su' into those accounts. I might be wrong in this one.
    Can you manually use 'su ttaserv' and 'su ttasys' without any problem? Do these users have a valid home-dir for example.
    - Remold

  • Surface Pro 2, Functionality Issues with Photoshop

    I've been working with PS for years, and previously used a Cintiq, but i would like to branch out somewhat to a Surface Pro 2 by Microsoft. However, i've been having issues with the way the pen works and how the program reacts to swiping.
    I would like to know if i can change the functionality of the button on the stylus on the Surface Pro, as i often have with my Cintiq tablet. Currently it pulls up the brush menu, when i would like it to function as an eraser.
    Further, PS seems to react to any upward swipe from my finger by throwing the view of the canvas wildly to the upper corner, rather than a gentle scroll.

    I've been working with PS for years, and previously used a Cintiq, but i would like to branch out somewhat to a Surface Pro 2 by Microsoft. However, i've been having issues with the way the pen works and how the program reacts to swiping.
    I would like to know if i can change the functionality of the button on the stylus on the Surface Pro, as i often have with my Cintiq tablet. Currently it pulls up the brush menu, when i would like it to function as an eraser.
    Further, PS seems to react to any upward swipe from my finger by throwing the view of the canvas wildly to the upper corner, rather than a gentle scroll.

  • SAP MII function issue in SAP MII 14.0

    Hi,
    Currently I was working on some content up gradation work in SAP MII 14.0 , but while working, I have got a strange think regarding SAP MII Functions. We have developed the same code in SAP MII 12.2 and faced the issue while migrating to 14.0. The issue is as follows,
    The function we have used in 12.2 is getvalue(name) as in the below screenshot,
    but while we have migrated to 14.0, then we saw the function has updated into getvalue(map, key) in 14.0
    I have no idea why parameter of the existing function got updated, but the problem is if someone want to migrate the existing code from 12.2 to 14.0 using such of function then he/she can get a "Conversion Exception" and at that time it will become bit hectic to identify the issue and change the logic to handle this in all the places.
    Regards,
    Suman

    Hello Suman,
       I guess it is a bug in MII 14.0. The help doc has the getValue(name) still. However, the newer function is not present in the same. I guess it was not documented. I guess, the getValue(map, name) is a newer function which somehow replaced the older one.
    I would suggest you to raise a support ticket. According to me, the getValue(name) and getValue(map, name), both should exist.
    Regards,
    Tufale Ashai.

  • Function issue:  inconsistent datatypes?

    Hi all.
    I'm having an issue with a function that converts coordinates to a spatial data type.
    My database version is:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE     11.2.0.2.0     Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Here's my package that I'm using
    create or replace package make_geometry
    as
                function get_geometry_from_coords (p_coords in clob  )
              return sdo_geometry;
    end;
    create or replace package body make_geometry
    as
              function get_geometry_from_coords (p_coords in clob)
              return sdo_geometry
              is
                 v_geometry sdo_geometry;
              begin
                 --with t as (select p_coords coords from dual)
              select MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
                                  ,cast(multiset(
                                      select ordset
                                     from (
                                            select regexp_substr( regexp_replace(
                                                                                replace(p_coords,chr(10))
                                                                                 ,' {1,}',',')
                                                                  ,'[^,]+',1,level)  ordset
                                                  ,rownum rn
                                              from dual
                                                               connect by level <= length(regexp_replace(regexp_replace(
                                                                                                   replace(p_coords,chr(10))
                                                                                                   ,' {1,}',','),'[^,]+')) + 1
                                            where mod(rn,3) <> 0
                        ) as sdo_ordinate_array))
                  into v_geometry
                  from dual;
                  return v_geometry;
              end;
    end;
    /basically, it takes a list of coordinates, in the following format:
    with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378437734999997,0 130.88164895999998,-12.379271400499997,0 ' coords from dual)replaces the spaces with commas and splits the resultant string by comma, then removes the third coordinate in each set (sets delimited by spaces in above example) and converts the result to sdo_geometry type.
    This logic is not where my problem is occurring
    If I run the query found in the package separately, it works fine:
    SQL> with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378437734999997,0 130.88164895999998,
    -12.379271400499997,0 ' coords from dual)
      2            select MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
      3                                ,cast(multiset(
      4                                    select ordset
      5                                   from (
      6                                          select regexp_substr( regexp_replace(
      7                                                                              replace(coords,chr(10))
      8                                                                               ,' {1,}',',')
      9                                                                ,'[^,]+',1,level)  ordset
    10                                                ,rownum rn
    11                                            from t
    12                                                             connect by level <= length(regexp_replace(regexp_replace(
    13                                                                                                 replace(coords,chr(10))
    14                                                                                                 ,' {1,}',','),'[^,]+')) +
    1
    15                                                               )
    16                                          where mod(rn,3) <> 0
    17                      ) as sdo_ordinate_array))
    18                from dual;
    MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),CAST(MULTISET(SELECTORDSETFROM(SELECTREGEXP_SUBSTR(REGE
    XP_REPL
    SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(130.882141, -12.37759, 130.881893, -12.378
    438, 13
    0.881649, -12.379271, NULL))but if I call the function:
    SQL> with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378
    -12.379271400499997,0 ' coords from dual)
      2  select make_geometry.get_geometry_from_coords(coords)
      3    from t;
    select make_geometry.get_geometry_from_coords(coords)
    ERROR at line 2:
    ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
    ORA-06512: at "HR.MAKE_GEOMETRY", line 13If I change the package to expect varchar2 the above example coordinate list works fine, but obviously that doesn't work when the coordinate list exceeds 4000 characters.
    any thoughts?

    not sure that is the problem:
    SQL> create table foo (mr_clob clob);
    Table created.
    SQL>
    SQL> insert into foo values ('testing'||chr(10)||'testing');
    1 row created.
    SQL>
    SQL> select replace(mr_clob,chr(10),'blah') from foo;
    REPLACE(MR_CLOB,CHR(10),'BLAH')
    testingblahtesting
    1 row selected.

  • Keyboard Functionality Issues in Finder (Mac OS X 10.5.4)

    I've recently begun to experience loss of the functionality of my keyboard in Finder on my personal laptop and work computer whenever I have a Wacom tablet plugged in. Restarting and unplugging the tablet sometimes works, but only after the 2-3 try.
    Basically, the modifier keys and Function keys continue to work and the middle portion of keyboard fails to respond whenever I try to type a letter or use the spacebar. For example, when I attempt to create a folder it's first untitled. Whenever I try to rename the folder I can highlight the text, I just can't rename the folder. The keys appropriate keys don't work. Now if I use a web browser (Safari 3.1.2) or any other application other than Finder the keyboard functionality returns. I am able to type and use the spacebar, as well as use the other keys. It's as if nothing is wrong.
    Has anyone else experienced this issue?
    I recently started to experience it on my work computer and wondered if it had something to do with a Wacom tablet being connected. It seemed whenever I left the tablet unplugged and restarted my Mac everything was normal. Only when the tablet is plugged in does the keyboard functionality loss bother me.
    Thanks to any who can help.

    Did ever you try the "Relaunch Finder" option in the force quit menu?

  • Jco Function issue : The initial password has expired (request a new one)

    Hi Friends,
         Could you please help me to resolve this issue. I am able to start my session using  SAP Jco Start Action block. But while invoking the BAPI using
    SAP JCo Function action block I am getting the below error. I am 100% sure that my credentials are correct. I am able to logon to ECC using SAP Front GUI.
    I am using MII 14.0 patch SP4
    Any help on this very much appreciated.
    <Rowsets DateCreated="2014-07-22T12:33:49" EndDate="2014-07-22T12:33:49" StartDate="2014-07-22T12:33:49" Version="14.0 SP4 Patch 0 (Nov 22, 2013)">
        <FatalError>JCOProxy error: Problem retrieving JCO.Function object: The initial password has expired (request a new one)</FatalError>
    </Rowsets>]]
    Thanks in advance
    Shaji

    Hi Friends,
    This issue got resolved when I cleared the BAPI list cache at MII using below URL.
    http://hostname:port/XMII/JCOProxy?Mode=Reset

Maybe you are looking for

  • Monthly TPM1 without reset for FX forward in Hedge Accounting

    Hi, I would like a clarification on the "standard" way of resetting the valuated position of an FX forward (using Hedge Accounting position management procedure) when using TPM1 and the "mid-year valuation without reset" option. When executing TPM1,

  • How can I open an app or file in finder with keyboard?

    I rather using keyboard instead of mouse for everything but I dont know how to open a file/app using the keyboard, if I press Enter it opens the file's name box. Any shortcut? Thanx MacBook Pro   Mac OS X (10.4.8)  

  • Regarding  to logic

    Hi All, Having doubt in ranges ? im having  variable date1 which carries value sy-datlo. for ex : 12.02.2008 My requirment is i want date that shoul be exactly less than 1000 days by the current system date(date1) Regards, Murthy

  • How to change a Shape3D node's picked in the branchGroup loade by OBJ file

    Hi,all I need your help! I loaded a OBJ file to add the its branchgroup to the scenegraph,then,I registered the mouse listener for the canvas3D, each time the canvas3D received a mouse click, i will use the pickInfo to get the picked node,then ,chang

  • WRT310N v1 firmware upgrade versions

    I have a WRT310N, apparently v1 since there's no version on the label and the firmware was a 1.x version initially.  I've upgraded it a couple of times and it's now at 1.0.07-LS-HND.  I've noticed there's now a v2 of this model.  Is it possible to up