Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: query enhancement

Re: query enhancement

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Fri, 15 Jun 2007 20:24:31 +0200
Message-ID: <f4ulgs$pl3$1@news2.zwoll1.ov.home.nl>


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

keeling wrote:

> index on this column. As a side note, I'm testing for the presence of
> null, because if found, I update all 'null' values with '-1'. I'm
> doing this because I intend to use this column as part of a primary
> key constraint.
>

Totally unnecessary:
update table set column_a =-1 where column_a is null.

Fastest method ever.
Still want to know how many? Use sql%rowcount after the update, it holds the number of changed records

Top-posting is one way to shut me up...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFGctlfLw8L4IAs830RAiINAJ9mmJS93H99YAvN6dY9qQ/SQ31sagCeI81d P/Ean+971Q9M1wsrFzcKJ1E=
=dgv6
-----END PGP SIGNATURE----- Received on Fri Jun 15 2007 - 13:24:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US