Converting varchar2(512) to RAW(512)
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Converting varchar2(512) to RAW(512)

  1. #1
    Join Date
    Jan 2001
    Posts
    36

    Converting varchar2(512) to RAW(512)

    Hi gurus

    I need to convert column with a datatype varchar2(512) to a RAW(512) datatype. It seems most people want to do the opposite. Is there a
    standard PLSQL or SQL function in Oracle 9i to convert ?

    Thanks in advance
    Mark

  2. #2
    Join Date
    Oct 2004
    Posts
    2
    SQL> create table testtable (id number,name varchar2(512));

    Table created.

    SQL> insert into testtable values (1,'firestorm');

    1 row created.

    SQL> commit;

    Commit complete.

    SQL> alter table testtable add nameraw raw(512);

    Table altered.

    SQL> update testtable set nameraw=utl_raw.cast_to_raw(name);

    1 row updated.

    SQL> commit;

    Commit complete.
    SQL> alter table testtable drop column name;

    Table altered.

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