Re: PL/SQL conditions being ignored (query for a children's hospital)

From: Pieter J.D. Huiberts <phuiberts_at_ivwnet.com>
Date: Sat, 30 Mar 2002 09:07:16 -0500
Message-ID: <3CA5C694.8070808_at_ivwnet.com>


The Long datatype is a restricted data type. Thruogh a call interface you can manipulate it piecewise. I have not donw this but read about it in Oracle8 PLSQL programming

Hope this helps a bit!

Brad Campbell wrote:

> I'm a struggling query writer who's trying to figure out how to do a
> word search on long data type. The query executes without error.
> However, it doesn't recognize my nested if that's supposed to further
> limit which ID's are to be inserted into a temp table. For example, I
> don't want it to insert into that table any ID's where the text
> contains the string 'CODE%N' (where % is a wildcard). But it does get
> inserted despite the nested if that has a not condition for this
> (among others). Any help would be greatly appreciated. Thanks. Brad
> C.
>
> Below is my code:
>
> --------
> TRUNCATE TABLE research_list;
> DECLARE
> rpt varchar2(32000);
> crlf VARCHAR2(2);
> cursor csr is
> select ...; --statement not shown to avoid vendor hassle
> begin
> for prc in csr loop
> select result_text.long_result_value into rpt from result_text
> where result_text.result_addendum_id = prc.result_addendum_id;
> crlf := CHR(13)||CHR(10);
> rpt := upper(REPLACE(rpt,crlf, NULL));
> IF(rpt LIKE '%CERVICAL%FRACTURE%' or rpt LIKE '%CERVICAL%SUBLUXATION%'
> or rpt LIKE '%ATLANTO%OCCIPITAL DISSOCIATION%' or instr(rpt,'CHANCE
> FRACTURE')>0 or instr(rpt,'PELVIC FRACTURE')>0 or instr(rpt,'CHILD
> ABUSE')>0 or instr(rpt,'SHAKEN BABY')>0) THEN
> IF((instr(rpt,'NORMAL',-1) = 0) OR (instr(rpt,'NO EVIDENCE',-1) = 0)
> OR (rpt NOT LIKE '%CODE%N%') OR (instr(rpt,'NO FRACTURE',-1) = 0))
> then
> insert into research_list(result_Addendum_id, result_value)
> values (prc.result_addendum_id, rpt);
> end if;
> end if;
> end loop;
> end;
> ---------------
>
Received on Sat Mar 30 2002 - 15:07:16 CET

Original text of this message