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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Please check this syntax

Re: Please check this syntax

From: Josh White <whitegoose_at_inorbit.com>
Date: 4 Apr 2005 17:11:31 -0700
Message-ID: <aafea0a8.0504041611.3c91aa5a@posting.google.com>


DA Morgan <damorgan_at_x.washington.edu> wrote in message news:<1112627981.564561_at_yasure>...
>
> But why not just do this:
>
> SELECT CT.COMPCODE
> INTO v_compType
> FROM COMPTYPE CT
> WHERE CT.COMPTYPE = :newRow.COMPTYPE;
>
> IF v_compType IS NULL THEN
> do something;
> END IF;
>
> Why make it so complex?

Because v_compType shouldn't ever be null - and that's not what I'm interested in anyway. By concatenating 'COMP' and v_compType I get the name of a table (eg. If the COMPTYPE = 'BLDG' then I need to do further work in the table COMPBLDG). I then use the dynamic sql to get the BGTNO from COMPxxxx, and if it is null, I RAISE_APPLICATION_ERROR.

I should be receiving the Oracle 9.2 CDs today by courier so I should be able to work most things out for myself (hopefully) Thanks for your time and help - It's greatly appreciated. Received on Mon Apr 04 2005 - 19:11:31 CDT

Original text of this message

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