Char conversion to number

Hai all,
I have a colmn called Kilometers in table of datatype varchar and has got morethan 20,000 numeric records in it.. only numbers are getting stored in that column.. now am creating one more table with column called kiometres with datatype number..
I want to insert the records of table A.Kilometres to B.Kilometres.. I tried the follwoing :
insert into project_mileage (kilometres) select (to_number(kilometres,'9999999')) from project
am getttin the error :
ora-01722. invalid number.
how can I get the records inserted..
Thanks
Kai

If your data doesn't include other characters but numbers, you could rely on the implicit datatype conversion:
SQL> create table a(a varchar2(3));
Table created.
SQL> create table b(b number(3));
Table created.
SQL> insert into a values ('1');
1 row created.
SQL> insert into a values ('2');
1 row created.
SQL> insert into a values ('3');
1 row created.
SQL> commit;
Commit complete.
SQL> insert into b select * from a;
3 rows created.
SQL> commit;
Commit complete.
SQL> select * from b;
         B
         1
         2
         3
SQL>~ Madrid

Similar Messages

  • How to judge whether the chars contain only number and letter

    how to judge whether the chars contain only number and letter, for example :
    'AEs4386' is valid , but '‘´‘¼ew78' is not
    thanks for your help !

    Hi,
    try the following:
    data: l_test(36) type c.
    concatenate sy-abcde '0123456789' into l_test.
    l_test contains all letters all numbers now
    translate YourVariable to upper case.
    YourVariable contains only upper case letters
    check YourVariable co l_test. " or use if instead of check
    YourVariable contains only letters or numbers
    regards
    Siggi

  • Update was terminated - conversion no number

    dear all,
    while doing Me38 transaction , after updating the details i clicked on save.
    it saved. Again i press enter.
    i got the error 'express document: update was terminated received from author'.
    error analysis shows : conversion no number error.
    but this error is not coming in dev or qas server. it is coming only in production..
    how to rectify it ???
    waiting for reply,
    Thanks,
    Dhivya N.

    Hello Dhivya,
    This is conversion error occurs when we are trying to move numbers to a filed which cannot hold numbers.
    In st22 dump, you will find that number in "Short text".
    Go to "source code" in abap dump and check for the data type of the filed where the dump is encounter.
    Go to "chosen variable " in abap dump and you will be able to find the variable and its value.
    Thanks

  • Conversion from Char to Packed Number

    Hi,
    How do we convert a 18 byte char field(Which contains all numerics) in to a 8 byte field ?
    Regards,
    Hari

    Hi.,,
    what is your actual requirement ??
    if u want to move a character variable which contains all numerics into a P type field u can directly move it !!
    <b>data w_char(18) type c value '1234567'.
    data w_p type p decimals 2.
    move w_char to w_p.
    write w_p.</b>
    <u>If you want to hold large numbers then increase the size of P type variable..</u>
    <u>data w_p<b>(10)</b> type p decimals 2.</u>
    reward if it helps u..
    sai ramesh.

  • HEX to CHAR conversion in ECC 6.0

    Hi All,
    We have upgraded the client system from 4.6C to ECC 6.0. In one of the program the code was as below:
    c_code1(1) TYPE x VALUE '23',
    c_code2(1) TYPE x VALUE 'E1'.
    i_uml-uml = c_code1.
      APPEND i_uml.
      i_uml-uml = c_code2.
      APPEND i_uml.
    LOOP AT i_uml INTO w_char.
        SEARCH  i_rab_tab FOR w_char.
        IF sy-subrc = 0.                         
          MOVE 'X' TO w_found.
          EXIT.
        ENDIF.
      ENDLOOP.
    Here c_code1 and c_code2 are declared as hex and assigned 23 and E1. These codes are moved to itab i_umi. These valuse are assigned to w_char.
    When assigned to w_char, the hex value of 23 is converted to '#' and E1 is converted to 'ä'.
    Above logic is working in 4.6 but not working in ECC 6.0. The conversion of HEX to char is not working in 6.0. In ECC 6.0, when hex number 23 is assigned to w_char, it takes value as '2'.
    Please suggest me how can I make it work in ECC.
    Thanks in advance.
    regards,
    Gaurav

    Hi,
         Try with the below Z report by Changing the values for VALUE in  the below report and execute it you can get the hexadecimal conversion,
    data :  i1 type xstring,
            i2 type string,
            i3 type x.
    parameters: value like i3.
    i1 = value.
    CALL FUNCTION 'NLS_STRING_CONVERT_TO_SYS'
      EXPORTING
        lang_used                   = sy-langu
        source                      = i1
      FROM_FE                     = 'MS '
    IMPORTING
       RESULT                      = i2
      SUBSTED                     =
    EXCEPTIONS
       ILLEGAL_SYST_CODEPAGE       = 1
       NO_FE_CODEPAGE_FOUND        = 2
       COULD_NOT_CONVERT           = 3
       OTHERS                      = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write: i2.
    Thank U,
    Jay....

  • Conversion of NUMBER(2) to SMALLINT

    One of our Oracle tables has some columns that are defined as NUMBER(2). When added to synchronisation, these field definitions appear as SMALLINT on the oracle lite database and allow a value of up to 32767, therefore breaking the Big Oracle column definition and resulting in synchronisation errors.
    We are changing our application code to validate that the value entered into the column does not exceed 99 but is there any other way to avoid this datatype conversion

    we have not yet tried R3 as this would require an app server upgrade in terms of the version of Red Hat, which has knock on effects to other services from the same app server, and we do not have time at the moment to look at the implications.
    I did not raise a bug as in our case it actually highlighted that our database design was wrong - the number(3) column related to the number of properties being built on a housing development, and we validly have sites with the number running into the thousands, so we just increased the column size in this case.
    My feeling is that it is related to the Java data type conversions on the client being different to oracle, and the point of the error was during the upload when the data was being unpacked into the in queues, and we got a 'value larger than specified precision' error

  • Char conversion problem

    Hi all
    in the following query:
    select to_date('31-JUL-12', 'dd-MON-yy') res from dual;we have error:
    ORA-01843: not a valid month
    01843. 00000 -  "not a valid month"
    *Cause:   
    *Action:...this is the first strange error/for me :) /...
    After this conversion - i want to convert it to char.
    Expected output:
    2012/07/31 00:00:00Any ideas?
    Version: 11g
    Thanks in advance,
    Bahchevanov.

    bahchevanov wrote:
    Hi all
    in the following query:
    select to_date('31-JUL-12', 'dd-MON-yy') res from dual;we have error:
    ORA-01843: not a valid month
    01843. 00000 -  "not a valid month"
    *Cause:   
    *Action:...this is the first strange error/for me :) /...
    After this conversion - i want to convert it to char.
    Expected output:
    2012/07/31 00:00:00Any ideas?
    Version: 11g
    Thanks in advance,
    Bahchevanov.post results from following SQL
    select to_char(sysdate-1,'YYYY-MON-DD') FROM DUAL;

  • IMessage, Start new conversations from number missing?

    I sign in with my Apple-ID. But then apperienlty you can choose which you will start new conversations from, hotmail or number, but that does not appear for me? Settings ---> Messages ---> Send and recieve.       PLEASE HELP ME

    This worked for me.  Turn off iMessage in Settings---> Messages. Then turn off iPhone. Restart iPhone then turn iMessage back on.   The phone number should reappear.

  • String to char conversion

    How do I convert a string I have (I am sure its one character) in to char?

    you must mean char foo, instaead of String!
    char foo = "bar".toCharArray()[0];

  • Very simple Char* conversion operator not working

    This should be simple, but it's not working.  The code below gives me a compiler error:
    Error 2 error C2440: 'initializing' : cannot convert from 'Foo' to 'char *' 
    class Foo
     char * _data;
    public:
     operator const char * () { return _data; }
     Foo f;
     char * bar = f;
    char*_data;
    public
    operatorconstchar*(){return_data;}
    Eric Jorgensen http://www.ericjorgensen.com

    On 3/5/2015 12:26 AM, "Eric Jorgensen" wrote:
    This should be simple, but it's not working.  The code below gives me a compiler error:
    Error 2 error C2440: 'initializing' : cannot convert from 'Foo' to 'char *'
    Foo can be converted to const char*, but not to char*
    Igor Tandetnik

  • Char conversion

    Please sent me immediately when u get this mssg;;;;;
    Is there any methods like Integer.parseInt() for converting a String to charecter?
    Or plz send me a way to read charecter as commandline argument so that it can be used in Switch().

    You could use method from String class toCharArray().
         String s = "my string";
          char [] charray = s.toCharArray();

  • CHAR conversion to NUM.

    dear all,
    in BI7, how can i convert my CHAR into NUM datatype? data from external source is coming in as CHAR and i want to change it to type NUM. how can i do that in the update rule? thanks.

    Hi,
       Do Type casting to convert the CHAR into NUM datatype.
    Let's say,
    l_var1 --> Source variable in CHAR
    l_var2 --> Target variable in NUM
    Create a temporary variable variable l_temp as Type NUM.
    Make sure that l_var1 does not have any non-numeric values. Do a check for that.
    IF l_var1 CONTAINS ( 0,1,2,3,4,5,6,7,8,9 )
         l_temp = l_var1 (Type Casting)
         l_var2 = l_temp.
    ENDIF.
    This will work out.
    Regards,
    Balaji V

  • How to find data dictionary and oracle schema tables for UTF8 char conversi

    I am doing UTF8 char conversition, i got lot of convertable objects,as per document we don't need to worry about data dictionary objects and how to find data dictionary and oracle schema objects for UTF8 char conversition.
    USER.TABLE Convertible Truncation Lossy
    MDSYS.OPENLS_NODES 17 0 0
    MDSYS.SDO_COORD_OP_PARAM_VALS 200 0 0
    MDSYS.SDO_GEOR_XMLSCHEMA_TABLE 1 0 0
    MDSYS.SDO_STYLES_TABLE 78 0 0
    MDSYS.SDO_XML_SCHEMAS 3 0 0
    ORDDATA.ORDDCM_CT_PRED_OPRD 51 0 0
    ORDDATA.ORDDCM_DOCS 9 0 0
    ORDDATA.ORDDCM_MAPPING_DOCS 1 0 0
    SYS.METASTYLESHEET 178 0 0
    SYS.REGISTRY$ERROR 2 0 0
    SYS.RULE$ 21 0 0
    SYS.SCHEDULER$_EVENT_LOG 182 0 0
    SYS.WRH$_SQLTEXT 2,099 0 0
    SYS.WRH$_SQL_PLAN 1,736 0 0
    SYS.WRI$_ADV_ACTIONS 5,452 0 0
    SYS.WRI$_ADV_DIRECTIVE_META 5 0 0
    SYS.WRI$_ADV_OBJECTS 2,278 0 0
    SYS.WRI$_ADV_RATIONALE 9,594 0 0
    SYS.WRI$_ADV_SQLT_PLANS 455 0 0
    SYS.WRI$_ADV_SQLT_PLAN_STATS 288 0 0
    SYS.WRI$_DBU_FEATURE_METADATA 188 0 0
    SYS.WRI$_DBU_FEATURE_USAGE 16 0 0
    SYS.WRI$_DBU_HWM_METADATA 20 0 0
    SYS.WRI$_REPT_FILES 27 0 0
    XDB.XDB$DXPTAB 2 0 0
    XML CSX Dictionary Tables:
    USER.TABLE Convertible Truncation Lossy
    Application Data:
    USER.TABLE Convertible Truncation Lossy
    APPLSYS.BISM_OBJECTS 4 0 0
    APPLSYS.DR$FND_LOBS_CTX$I 0 103 1,260,883
    APPLSYS.FND_CONC_PROG_ANNOTATIONS 272 0 0
    APPLSYS.FND_OAM_CONTEXT_FILES 15 0 0
    APPLSYS.FND_OAM_DOC_LINK 1 0 0
    APPS.FND_OAM_CONTEXT_FILES_1 6 0 0
    AZ.AZ_APIS 11 0 0
    AZ.AZ_SELECTION_SET_ENTITIES_B 48 0 0
    ECX.ECX_DTDS 205 0 0
    ECX.ECX_FILES 91 0 0
    IBC.IBC_ATTRIBUTE_BUNDLES 41 0 0
    JTF.JTF_HEADER_DTD 1 0 0
    JTF.JTF_MESSAGE_OBJECTS 82 0 0
    JTF.JTY_TRANS_USG_PGM_SQL 29 0 0
    ODM.ODM_PMML_DTD 1 0 0
    OKC.OKC_REPORT_SQL_B 3 0 0
    OKC.OKC_REPORT_SQL_TL 2 0 0
    OKC.OKC_REPORT_XSL_TL 5 0 0
    XDP.XDP_PROC_BODY 10 0 0
    [Distribution of Convertible, Truncated and Lossy Data by Column]
    Data Dictionary Tables:
    USER.TABLE|COLUMN Convertible Truncation Lossy
    MDSYS.OPENLS_NODES|SYS_NC00004$ 17 0 0
    MDSYS.SDO_COORD_OP_PARAM_VALS|PARAM_VALUE_FILE 200 0 0
    MDSYS.SDO_GEOR_XMLSCHEMA_TABLE|XMLSCHEMA 1 0 0
    MDSYS.SDO_STYLES_TABLE|DEFINITION 78 0 0
    MDSYS.SDO_XML_SCHEMAS|XMLSCHEMA 3 0 0
    ORDDATA.ORDDCM_CT_PRED_OPRD|SYS_NC00004$ 51 0 0
    ORDDATA.ORDDCM_DOCS|SYS_NC00005$ 9 0 0
    ORDDATA.ORDDCM_MAPPING_DOCS|SYS_NC00007$ 1 0 0
    SYS.METASTYLESHEET|STYLESHEET 178 0 0
    SYS.REGISTRY$ERROR|MESSAGE 1 0 0
    SYS.REGISTRY$ERROR|STATEMENT 1 0 0
    SYS.RULE$|CONDITION 21 0 0
    SYS.SCHEDULER$_EVENT_LOG|ADDITIONAL_INFO 182 0 0
    SYS.WRH$_SQLTEXT|SQL_TEXT 2,099 0 0
    SYS.WRH$_SQL_PLAN|OTHER_XML 1,736 0 0
    SYS.WRI$_ADV_ACTIONS|ATTR5 2,726 0 0
    SYS.WRI$_ADV_ACTIONS|ATTR6 2,726 0 0
    SYS.WRI$_ADV_DIRECTIVE_META|DATA 5 0 0
    SYS.WRI$_ADV_OBJECTS|ATTR4 2,278 0 0
    SYS.WRI$_ADV_RATIONALE|ATTR5 9,594 0 0
    SYS.WRI$_ADV_SQLT_PLANS|OTHER_XML 455 0 0
    SYS.WRI$_ADV_SQLT_PLAN_STATS|OTHER 288 0 0
    SYS.WRI$_DBU_FEATURE_METADATA|INST_CHK_LOGIC 21 0 0
    SYS.WRI$_DBU_FEATURE_METADATA|USG_DET_LOGIC 167 0 0
    SYS.WRI$_DBU_FEATURE_USAGE|FEATURE_INFO 16 0 0
    SYS.WRI$_DBU_HWM_METADATA|LOGIC 20 0 0
    SYS.WRI$_REPT_FILES|SYS_NC00005$ 27 0 0
    XDB.XDB$DXPTAB|SYS_NC00006$ 2 0 0
    XML CSX Dictionary Tables:
    USER.TABLE|COLUMN Convertible Truncation Lossy
    Application Data:
    USER.TABLE|COLUMN Convertible Truncation Lossy
    APPLSYS.BISM_OBJECTS|SYS_NC00023$ 4 0 0
    APPLSYS.DR$FND_LOBS_CTX$I|TOKEN_TEXT 0 103 1,260,883
    APPLSYS.FND_CONC_PROG_ANNOTATIONS|PROGRAM_ANNOTAT 272 0 0
    APPLSYS.FND_OAM_CONTEXT_FILES|TEXT 15 0 0
    APPLSYS.FND_OAM_DOC_LINK|DOC_LINK_INFO 1 0 0
    APPS.FND_OAM_CONTEXT_FILES_1|TEXT 6 0 0
    AZ.AZ_APIS|FILTERING_PARAMETERS 11 0 0
    AZ.AZ_SELECTION_SET_ENTITIES_B|FILTERING_PARAMETE 48 0 0
    ECX.ECX_DTDS|PAYLOAD 205 0 0
    ECX.ECX_FILES|PAYLOAD 91 0 0
    IBC.IBC_ATTRIBUTE_BUNDLES|ATTRIBUTE_BUNDLE_DATA 41 0 0
    JTF.JTF_HEADER_DTD|HEADER_DTD 1 0 0
    JTF.JTF_MESSAGE_OBJECTS|BUS_OBJ_DTD 41 0 0
    JTF.JTF_MESSAGE_OBJECTS|BUS_OBJ_SQL 41 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|BATCH_DEA_SQL 1 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|BATCH_INCR_SQL 5 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|BATCH_TOTAL_SQL 6 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|INCR_REASSIGN_SQL 5 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|REAL_TIME_INSERT 6 0 0
    JTF.JTY_TRANS_USG_PGM_SQL|REAL_TIME_SQL 6 0 0
    ODM.ODM_PMML_DTD|DTD 1 0 0
    OKC.OKC_REPORT_SQL_B|SQL_TEXT 3 0 0
    OKC.OKC_REPORT_SQL_TL|HELP_TEXT 2 0 0
    OKC.OKC_REPORT_XSL_TL|HELP_TEXT 2 0 0
    OKC.OKC_REPORT_XSL_TL|XSL_TEXT 3 0 0
    XDP.XDP_PROC_BODY|PROC_BODY 10 0 0
    -------------------------------------------------- ---------------- ---------------- ----------------

    Hi;
    Please run below query which could be helpful for your issue:
    select * from dictionary where TABLE_NAME LIKE '%NLS%'
    select * from dictionary where TABLE_NAME LIKE '%GLOBAL%'
    Regard
    Helios

  • Ascii - char conversion

    What is the easiest way to convert from an ascii value to its corresponding char? I want to make a table of the unicode character set from values 32 to 126 with simple for loop. The only thing I could find online was String.fromCharCode() which didn't work since it's javascript.

    What is the easiest way to convert from an ascii value
    to its corresponding char? I want to make a table of
    the unicode character set from values 32 to 126 with
    simple for loop. The only thing I could find online
    was String.fromCharCode() which didn't work since it's
    javascript.The first 128 characters of all unicode character sets corresponds exactly to ASCII.
    For UTF-8....
    x00 => x00
    x01 => x01
    x7f => x7f
    For a 16 bit unicode charset it would be...
    x00 => x0000
    x01 => x0001
    x7f => x007f

  • Conversion in Number

    Hi All,
    CREATE TABLE t2(a VARCHAR2(1000));
    INSERT INTO t2 VALUES (100000000000000000);
    COMMIT;
    SELECT to_number(a) FROM t2;
    --output - 1E17
    DROP TABLE t2 PURGE;
    Any way to display actual number i.e 100000000000000000 ,not 1E17 format.
    Thanks.

    in SQL*Plus use the option set numwidth.
    SQL> select to_number('100000000000000000') from dual;
    TO_NUMBER('100000000000000000')
                         1.0000E+17
    SQL> set numwidth 50;
    SQL> select to_number('100000000000000000') from dual;
                       TO_NUMBER('100000000000000000')
                                    100000000000000000
    SQL>

Maybe you are looking for

  • 'F4IF_INT_TABLE_VALUE_REQUEST' how to display description

    Hi All, I'm showing such help using 'F4IF_INT_TABLE_VALUE_REQUEST' TYPE RE KR TY Now the requiremnt is to show description also along with that like : TYPE   Description RE       Invoice-xyz KR       Invoice-abc TY       Invoice-pqr Below is my code

  • How to uninstall a plug-in?

    This is with Photoshop CC 2014 on Windows 7. Help > System Info reports the following (at the very end of the list): Optional and third party plug-ins:    SilverFast 8 x64 10.0 Plug-ins that failed to load: NONE Flash: Installed TWAIN devices: NONE T

  • Lightroom 3: Edit in Photoshop CS5 no longer saves a copy as TIFF for editing

    Hi, I have Lightroom 3 (LR3) and Photoshop CS5 (non Extended) and Snow  Leopard on OSX.  Both LR3 and CS5 are filly updated.  CS5 updated with  Camera Raw 6.1. On one day, when I tell LR3 to "Edit in Photoshop" it would save a copy  of the NEF with c

  • Where to find an app to how to find my mac // in case it's stolen or ??? //

    where to find an app how to find my mac in case gets stolen or???

  • Php form mailer/Flash help

    I have a php form that I am using with my Flash file. It works great so far, but I would like to get confirmation from the php in the Flash file, that the info has really been sent. I think it is already sent up in the php, but I don't know how to ha