DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: ORA-00932: inconsistent datatypes: expected NUMBER got LONG

  1. #1
    Join Date
    Aug 2007
    Posts
    62

    ORA-00932: inconsistent datatypes: expected NUMBER got LONG

    Hi,

    I'm trying to change one of the column in my table from LONG datatype to VARCHAR2 datatype.

    I intend to create an new column using the SQL below:
    Code:
    alter table id_table add content_new varchar2(4000)
    Followed by copying the content column using:
    Code:
    update id_table set content_new=content
    However, i got the following error.
    Code:
    ORA-00932: inconsistent datatypes: expected NUMBER got LONG
    Is there any way i can work around this? Thanks in advance!

  2. #2
    Join Date
    Nov 2002
    Location
    Mooresville, NC
    Posts
    349
    For character data type you need to use ''.
    Do it like this.
    update id_table set content_new='content'
    http://www.perf-engg.com
    A performance engineering forum

  3. #3
    Join Date
    Aug 2007
    Posts
    62
    Sorry, i think i didn't make myself clear enough.

    I mean to use :
    Code:
    update id_table set content_new=content
    to copy the data in column CONTENT to column CONTENT_NEW, not to update the column CONTENT_NEW with the word 'content'.

    I can't find the work around to copy a column of LONG type data...

  4. #4
    Join Date
    Nov 2002
    Location
    Mooresville, NC
    Posts
    349
    Then you need to write one function which will convert Long to varchar2 and using that function you would be able to achieve.
    http://www.perf-engg.com
    A performance engineering forum

  5. #5
    Join Date
    Jan 2008
    Posts
    7

    Smile

    You may need to use CLOB instead of VARCHAR2 to convert LONG data type values. Some of your existing values may be too large to be contained in a VARCHAR2 in Oracle database.

    DSupp2008

Posting Permissions

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


Click Here to Expand Forum to Full Width