Re: How to get the part of the string?
Date: Tue, 27 Nov 2001 14:42:56 GMT
Message-ID: <3c03a66b.0_at_news.cali.co.uk>
try the following....
select decode(instr(val1,'&'),0,0,to_number(substr(val1,instr(val1,'&')+1))) from dual;
where val1 = 'asdfg&1234' or 'asdfg124'
hope this is what you were after...
Богомол Александр Анатольевич <bogomol_at_investbank.ru> wrote:
>In additional:
> I need to use retrieved numbers for calculating.
> So such sql doesn't work
>a= 'abcdef';
>
> Select to_number(substr(a,instr(a,'&')+1)) from dual;
>
>When '&' is missed, I get an error.
>
>
> ----- Исходное сообщение-----
> От: Богомол Александр Анатольевич
> Помещено: 27 ноября 2001 г. 15:16
> Помещено в: tools
> Предмет: How to get the part of the string?
> Тема: How to get the part of the string?
>
> In additional:
> I need to use retrieved numbers for calculating.
> So such sql doesn't work
> a= 'abcdef';
>
> Select to_number(substr(a,instr(a,'&')+1)) from dual;
>
> When '&' is missed, I get an error.
>
Received on Tue Nov 27 2001 - 15:42:56 CET
