Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: substr() woes in GERMAN_GERMANY.WE8MSWIN1252

Re: substr() woes in GERMAN_GERMANY.WE8MSWIN1252

From: tojo <Tojo_at_hotmail.com>
Date: Wed, 7 Jul 2004 11:16:12 +0200
Message-ID: <MPG.1b55ddc95a6fd5a49896f3@news.t-online.de>


In article <zCNGc.2$z9.51_at_news.oracle.com>, sunil_franklin_at_hotmail.com says...
> Experts,
> I have code like the following which works when NLS_LANG env variable is
> not set but the moment I set my nls_lang variable to
> GERMAN_GERMANY.WE8MSWIN1252, it fails with " ORA-06502: PL/SQL: numerisch
> oder Wertefehler : Fehler bei Konvertierung von Zeichen zu Zahl "
> Any ides on how to overcome this.
>
> function get_major_version(p_version_str in varchar2)
> return pls_integer as
> l_position integer;
> l_version_int integer;
> begin
> l_position := instr(p_version_str, '.');
> l_version_int := to_number(substr(p_version_str, 1, l_position));
> return l_version_int;
> end;
>
> Thanks,
> Sunil.
>
>
>

If you just want the integer part of the number, you can also use TRUNC.

Received on Wed Jul 07 2004 - 04:16:12 CDT

Original text of this message

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