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

Thread: 2 Oracle Questions

Hybrid View

  1. #1
    Join Date
    Jan 2000
    Location
    Adelphi, Md. USA
    Posts
    28
    Hi,

    1. I have two questions... I want to create a binary field with the data type long raw. When I insert, I am expecting to see a 32-bit binary field displayed. This is what I am doing:

    create table fac
    (fac_id long raw);

    insert into fac (fac_id)
    values('AAAAAAAA');

    ... But an "A" is displayed instead. I realize that A is an hex. Does anyone know how to insert hex to raw into long raw datatypes?

    2. I have three tables.. the first one with values on a field that I want on the next two tables. Can anyone share a PL/SQL that updates the next two table with the value from the first table.

    Thanks

  2. #2
    Join Date
    Jul 2000
    Posts
    296
    1. Use HEXTORAW function
    From Oracel 8i SQL Reference:
    INSERT INTO graphics (raw_column)
    SELECT HEXTORAW('7D') FROM DUAL;

    2. Why use PL/SQL? You can use SQL, try something like:
    UPDATE tabb b
    SET colb =
    ( SELECT a.cola
    FROM taba a
    WHERE b.taba_id = a.id
    )


  3. #3
    Join Date
    Jul 2000
    Posts
    296
    I just tested inserting long raw value with hextoraw. The problem is not the insert but the select. I inserted in SQL*Plus value ('AAAAAAAA') with and without hextoraw in long raw column, when i select column value 'A' is returned. SQL*Navigator returns for both rows the (same) binary value.

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