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 Clarification.

Re: Query Clarification.

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Sat, 29 Oct 2005 05:20:47 GMT
Message-Id: <pan.2005.10.29.05.20.47.84082@sbcglobal.net>


On Thu, 27 Oct 2005 18:58:26 -0700, Scott wrote:

> I want to update the ColStatusB of Table B, only if the IDs in both
> table matches and the colCheckC of TableC is of a particular type, say
> 'Out of Stock'. I have written this query and it does not seem to work.
>
> UPDATE TABLEB SET ColStatusB = 'Updated' WHERE ColIDB = '' AND EXISTS
> SELECT colCheckC FROM TABLEC WHERE ColIDC = '' AND colCheckC NOT IN
> ('',''))
>
> These are the Table Structures of 2 tables,
>

Scotty, you shouldn't use comparison with '', you should compare with the NULL value, is "colidc is null" and "colcheckc is not null". Of course, such comparisons cannot use normal B-tree indexes. It's all in the manuals, which are on http://tahiti.oracle.com. If it is hard for you to read manuals, there is a great list where your questions can get answered. Look into the thread named "Beginners list" for details.

-- 
http://www.mgogala.com
Received on Sat Oct 29 2005 - 00:20:47 CDT

Original text of this message

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