Oracle??????ж????????????????
???????????? ???????[ 2015/4/29 15:55:13 ] ????????Oracle ???? ?????
1 CREATE OR REPLACE FUNCTION isnumeric (str IN VARCHAR2)
2 RETURN NUMBER
3 IS
4 v_str VARCHAR2 (1000);
5 BEGIN
6 IF str IS NULL
7 THEN
8 RETURN 0;
9 ELSE
10 v_str := translate(str?? '.0123456789'?? '.');
11
12 IF v_str = '.' OR v_str = '+.' OR v_str = '-.' OR v_str IS NULL
13 THEN
14 RETURN str;
15 ELSE
16 RETURN 0;
17 END IF;
18 END IF;
19 END isnumeric;
???????????
????TRANSLATE(string??from_str??to_str)
???????????
??????????????г?????from_str?е????????滻?to_str?е???????????string??TRANSLATE ?? REPLACE ?????????????????????? from_str ?? to_str ????????? from_str ?ж????? to_str ?е??????????? string ?б??????????????????????滻?????to_str ????????Oracle ?????????????? NULL?????????TRANSLATE ?е??κβ????NULL??????????? NULL??
???????????
????Sql????
1. SELECT TRANSLATE('abcdefghij'??'abcdef'??'123456') FROM dual;
2. TRANSLATE (
3. --------------
4. 123456ghij
5.
6. SELECT TRANSLATE('abcdefghij'??'abcdefghij'??'123456') FROM dual;
7. TRANSL
8. ----------
9. 123456
????????TRANSLATE(expr??from??to)
????expr: ????????????from ?? to ???????????????????????????????????????
??????????
????select translate('abcbbaadef'??'ba'??'#@') from dual????b???????????a???????????
????select translate('abcbbaadef'??'bad'??'#@') from dual????b???????????a???????????d?????????????????????
??????????????????@#c##@@def ??@#c##@@ef
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11