Re: More on ORA-01722

From: Eric <eric_at_deptj.eu>
Date: Thu, 21 Mar 2013 21:08:25 +0000
Message-ID: <slrnkkmtm9.8ij.eric_at_teckel.deptj.eu>



On 2013-03-21, Kay Kanekowski <kay.kanekowski_at_web.de> wrote:
> a little testcase why i prefer datatype conversion on the left side:
> create table kk_num ( wert varchar2(10));
>
> Tabelle wurde erstellt.
>
> insert into kk_num values ('1');
> insert into kk_num values ('1,0');
> insert into kk_num values ('+1,0');
> insert into kk_num values ('01');
>
> select * from kk_num where wert = 1;
>
> WERT
> ----------
> 1
> 1,0
> +1,0
> 01
>
> select * from kk_num where wert = to_char(1);
>
> WERT
> ----------
> 1

Well that's all obvious, except why you are going on about the "left side" which is irrelevant since

select * from kk_num where 1 = wert;

produces the same result - it is NOT which side that matters!

Eric

-- 
ms fnd in a lbry
Received on Thu Mar 21 2013 - 22:08:25 CET

Original text of this message