ora-01722无效数字 求指点,谢谢
两段代码,一能执行,二报错ora-01722无效数字,指向NVL,就多了个where条件,Google了一天没找到答案
SELECT bb_get_info_detail_f (1094,
NVL (a.build_id, 0)
) hose_code
FROM bb_service_relation_t a, bb_gsm_service_info_t b
SELECT bb_get_info_detail_f (1094,
NVL (a.build_id, 0)
) hose_code
FROM bb_service_relation_t a, bb_gsm_service_info_t b
WHERE b.product_end_date >= TO_DATE ('2013-05-8', 'yyyy-MM-dd')
AND b.product_end_date < TO_DATE ('2014-02-19', 'yyyy-MM-dd') + 1
AND a.user_id = b.user_id
AND a.if_valid = 1
CREATE OR REPLACE FUNCTION isnumeric (str IN VARCHAR2)
RETURN NUMBER
IS
v_str FLOAT;
BEGIN
IF str IS NULL
THEN
RETURN 0;
ELSE
BEGIN
SELECT TO_NUMBER (str)
INTO v_str
FROM DUAL;
EXCEPTION
WHEN INVALID_NUMBER
THEN
RETURN 0;
END;
RETURN 1;
END IF;
END isnumeric;