return '0' means number
return '1' means others
create function is_number(val in varchar2) return varchar2
as
begin
if to_number(val)<>to_number(val)+1 then
return '0';
end if;
return '1';
exception
when others then
return '1';
end;
/
return '1' means others
create function is_number(val in varchar2) return varchar2
as
begin
if to_number(val)<>to_number(val)+1 then
return '0';
end if;
return '1';
exception
when others then
return '1';
end;
/
解决方案 »
- 表結構設計的一些問題,大家發表下
- 怎样将oracle中某一张表的数据导出为dmp文件???
- STAR_TRANSFORMATION_ENABLED如何设置
- PL/SQL Developer 正式版哪儿有下载
- 同时(并发)向数据库插入多条记录(10条),单个插入操作用时好象比原来多很多(单个1秒以上),为什么,怎么解决?
- 请教proc高手:proc 连接与网络函数select 冲突的bug
- 在oracle9iOracle9i能在 profesional 下安装吗?
- 存储过程中如何使用字符连接?
- 通过培训学unix oracle好吗?请教!在北京,哪的培训机构比较好!
- oracle11G 查询语句问题
- 请问在哪里可以down到oracle参考手册, 多谢!
- 请教各位大侠们一个SQL
--収支年月判断(英数字)
-----------------------
FOR i IN 1..LENGTHB(jigyousyo) LOOP
IF SUBSTRB(jigyousyo, i, 1) NOT IN (
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
)
THEN
RAISE my_suji_error;
END IF;
END LOOP;
这样写,,可以吗??还有其他的优化办法吗??
return '0' means number 数字
return '1' means Upper letter 大写字母
return '2' means Lower Letter 小写字母
return '-1' means other 其他
=============================================================================*/create function Is_NumberAndLetter(val in char)
return number
is
begin
if (Ascii(val)>=48 and ascii(val)<=57) then
return '0';
end if; if (Ascii(val)>=65 and ascii(val)<=90) then
return '1';
end if; if (Ascii(val)>=97 and ascii(val)<=122) then
return '2';
end if;
return '-1';
exception
when others then
return '-1';
end Is_NumberAndLetter;
/