create or replace function ismdatacenter.isnumber(strtemp in varchar) return boolean is inttemp int; begin inttemp:=to_number(strtemp); return true; except return false; end;
select NVL(LTRIM(translate(字段名,'0123456789','000000000'),'0'),0) from dual 如果返回的是0,那么表示是全部由数字组成的
SQL> select * from aa;NAME -------------------- a123 2123 21235124 21235RR124SQL> edit 已写入文件 afiedt.buf 1* select NVL(LTRIM(translate(name,'0123456789','000000000'),'0'),0) from aa SQL> /NVL(LTRIM(TRANSLATE(NAME,'0123456789','0 ---------------------------------------- a000 0 0 RR000SQL>
select to_number(col) from table; 如果sql报错,则表示不全部是数字。
有么?
我没找到
要是写的话怎么写那?
inttemp int;
begin
inttemp:=to_number(strtemp);
return true;
except
return false;
end;
如果返回的是0,那么表示是全部由数字组成的
--------------------
a123
2123
21235124
21235RR124SQL> edit
已写入文件 afiedt.buf 1* select NVL(LTRIM(translate(name,'0123456789','000000000'),'0'),0) from aa
SQL> /NVL(LTRIM(TRANSLATE(NAME,'0123456789','0
----------------------------------------
a000
0
0
RR000SQL>
如果sql报错,则表示不全部是数字。