Re: SQL problem

From: <pberetta_at_my-deja.com>
Date: Mon, 17 Jan 2000 13:31:14 GMT
Message-ID: <85v5j2$775$1_at_nnrp1.deja.com>


Michael,
  I've never used the long raw datatype, but this might work. Assuming field1 is not unique (otherwise you could use it in the WHERE clause), how about getting the ROWID of the record you wish to model, then:

UPDATE your_table
SET field2 =
  ( SELECT field2
    FROM your_table
    WHERE ROWID = 'rowid_of_correct_field2_record' );

That being said, might it not be more efficient to create a new table containing just a primary key and, for now anyway, this single long raw, then replace the original table with one that stores only the key. Storing 1500 copies of the same graphic seems like a waste. Hope this helps,
Paul

In article <3882CCA9.3B2B7524_at_informasa.es>,   Michael Francis Horrocks <M.F.Horrocks_at_informasa.es> wrote:
> All,
> I am a newbie DBA and one of my Users has laid the following
> problem on my desk
> can anyone help?
>
> I have a table with the following columns:
>
> field1 VARCHAR2(50)
> field2 LONG RAW (store graphical)
>
> this table has 1,500 rows
>
> The problem is that I have to update the long raw field in 1,4999
rows
> with the one row which is correct (I know which one is correct)
> How can I do it? I can't use sub queries with long raw type.
>
> Regards,
> Michael
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Jan 17 2000 - 14:31:14 CET

Original text of this message