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: Question

Re: Question

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Fri, 14 Feb 2003 16:22:51 GMT
Message-ID: <MPG.18b6b7b24d1cd9709896a6@news.la.sbcglobal.net>


thechessPUSSAVIASPAMMERplayer_at_tin.it said...
>
> "Sybrand Bakker" <gooiditweg_at_sybrandb.demon.nl> ha scritto nel messaggio
> news:11vc4v43d0t0b12r37ir4ss3rocitn5v46_at_4ax.com...
> > On Sun, 9 Feb 2003 14:47:49 +0100, "Francesco S. Rinaldi"
> > <thechessPUSSAVIASPAMMERplayer_at_tin.it> wrote:
> >
> > >How can I do that ?
> >
> > By looking up 'OUTER JOIN' in your sql reference manual.
> >
> >
>
> Ok, thanks for you answer, I solved in part my problems, but there is still
> a problem I'm not able to solve.
> This query works:
> SELECT distinct history.object_id, history.center, cvtest_1_sen_.v_depl_v
> FROM history, cvtest_1_sen_ WHERE history.object_id like '3022%' and
> history.object_id=cvtest_1_sen_.object_id(+)
> (you could tell me that left join is done with (+) in ORACLE :)).
> Now, I'd like to have the string 'N.A.' when there is no v_depl_v.
> I tried this :
>
> SELECT distinct history.object_id, history.center,
> nvl(cvtest_1_sen_.v_depl_v, 'NA') FROM history, cvtest_1_sen_ WHERE
> history.object_id like '3022%' and
> history.object_id=cvtest_1_sen_.object_id(+)
>
> but even if in some similar cases it worked, in this case (and in other), I
> receive the error message:
> ORA-01722 Invalid number ....
>
>
> Why is this happening ?
>
> Thanks in advance,
> Francesco
>

I assume that v_dep1_v is a numeric field? If so, you can't put an alpha literal ('NA') in it, and you might need to replace your nvl with something like:

decode(cvtest_1_sen.v_dep1_v, null, 'NA', cvtest_1_sen.v_dep1_v)

-- 
/Karsten
DBA > retired > DBA
Received on Fri Feb 14 2003 - 10:22:51 CST

Original text of this message

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