Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    84

    Unanswered: SQL Help: ---conversion from number to varchar2.

    Hello experts, I am doing some data migration and need some help.
    Here is the table structure..
    PAGE_TWO
    ( ID NUMBER, LIST NUMBER(10), MULTILIST VARCHAR2(255));
    I want to move the values that are in LIST into MULTILIST columns.
    Value in LIST column which is 12345 should look as ,12345, after migration (comma before and after the number). Can you please help validate the SQL..Here is what I have... Do I need to use any fuction to convert the num to varchar? I ran the below sql and it went through..Just want to make sure.


    update page_two set multilist02=','||list08||',' where class=7000 and id=17436524;
    Kishore

  2. #2
    Join Date
    Feb 2004
    Location
    Dublin, Ireland
    Posts
    212
    your solution is correct as oracle uses auto conversion.
    or you can use cast() just to make sure
    Code:
    update page_two 
    set multilist = ',' || cast(list as varchar2(10)) || ',' 
    where class=7000 and id=17436524;
    Last edited by madafaka; 11-29-05 at 18:34.

  3. #3
    Join Date
    Mar 2004
    Posts
    84
    Quote Originally Posted by madafaka
    your solution is correct as oracle uses auto conversion.
    or you can use cast() just to make sure
    Code:
    update page_two 
    set multilist = ',' || cast(list as varchar2(10)) || ',' 
    where class=7000 and id=17436524;
    Hi, Thanks..
    Kishore

Posting Permissions

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