Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: use invalid_number to check alpha charater in varchar field ?
You can use, for example:
v734>drop table t;
Table dropped.
v734>create table t (c1 varchar2(10));
Table created.
v734>insert into t values ('1234');
1 row created.
v734>insert into t values ('a333');
1 row created.
v734>insert into t values ('3345');
1 row created.
v734>insert into t values ('444b');
1 row created.
v734>set serveroutput on
v734>declare
2 n number;
3 begin
4 dbms_output.enable(1000000); 5 for rec in (select c1 from t) loop 6 begin 7 n := to_number (rec.c1); 8 exception 9 when invalid_number then 10 dbms_output.put_line (rec.c1); 11 when value_error then 12 dbms_output.put_line (rec.c1); 13 end; 14 end loop;
a333
444b
PL/SQL procedure successfully completed.
tedchyn_at_yahoo.com a écrit dans le message <7r3god$q1t$1_at_nnrp1.deja.com>...
>Sir: I have a table test with column c1 with varchar2(10).
>
>c1
>-------
>1234
>a333
>3345
>444b
>
>How do I use pl/sql block and invalid_number exception to output two
>record contain alpha character ?
>
>a333
>444b
>
>Thanks in advance(tedchyn_at_yahoo.com)
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Wed Sep 08 1999 - 04:10:36 CDT
![]() |
![]() |