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: error when select xmltype

Re: error when select xmltype

From: Jeremy <jeremy0505_at_gmail.com>
Date: Fri, 18 Nov 2005 13:43:20 -0000
Message-ID: <MPG.1de7ead5ba91576498a028@news.individual.net>


In article <1132307588.347498.21700_at_g44g2000cwa.googlegroups.com>, stephen O'D says...
>
> mic0355 wrote:
> > what's wrong in the following pl/sql code?
> > DECLARE
> > va VARCHAR2(10);
> > vb VRACHAR2(10);
> > BEGIN
> > va := 'CA';
> > select '1' into :vb from tmptable p
> > where p.criteria.existsnode('/MSG[Type=va]') = 1;
> > END;
> > :
> > I got sql error "1403" when running the above sql. Then i tried to
> > replace va by "CA" (ie. select 1 into :a from tmptable p where
> > p.criteria.existsnode('/MSG[Type="CA"]') = 1; ) and could get the
> > expected result without any sql error.
>
> Remove the colon before vb and it should work:
>
> select '1' into vb from tmptable ...
>
>

Looks like he needs to do this instead:

..
..
 where p.criteria.existsnode('/MSG[Type="'||va||'"]') = 1; ..
..

va is the variable containing the string 'CA'

Or I could be completely misreading the problem.

-- 

jeremy
Received on Fri Nov 18 2005 - 07:43:20 CST

Original text of this message

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