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: pl help me in oracle

Re: pl help me in oracle

From: Robbert van der Hoorn <reply_at_forum.only>
Date: Thu, 28 Sep 2006 11:57:58 +0200
Message-ID: <451b9cb0$0$4524$e4fe514c@news.xs4all.nl>

"saravanan" <saravanan120480_at_gmail.com> schreef in bericht news:1159429497.091295.160270_at_i42g2000cwa.googlegroups.com...
> hi,
> ls_line1 :=SUBSTR(trim(ls_line1),6,LENGTH(ls_line1));
> // this variable contains the value '126/1'
> ls_statement_no := SUBSTR(ls_line1, 1,INSTR(ls_line1,'/',1)- 1 ) ;
> // this variable contains the value '126'
> li_statement_no:=to_number(ls_statement_no);
>
> // it is working fine
>
> ls_page_no := SUBSTR(trim(ls_line1),
> INSTR(ls_line1,'/',1)+1,LENGTH(ls_line1));
> // this variable contains the value '1'
> li_page_no:=to_number(ls_page_no)
> when we convert the string to number , i got an error. the error is
> 06502- character to number conversion error
> even if i did the implicit conversion, it is throwing an error
>

If you run the code like this, ls_page_no will not be '1', because ls_line1 will be '126' when you do
ls_page_no := SUBSTR(trim(ls_line1),
 INSTR(ls_line1,'/',1)+1,LENGTH(ls_line1));

You have already 'destroyed' its original value in your first line of code by stripping off the '/1'!

Robbert Received on Thu Sep 28 2006 - 04:57:58 CDT

Original text of this message

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