标签:
DROP PROCEDURE PROC_Z4; CREATE PROCEDURE proc_z4() BEGIN DECLARE card CHAR(20); DECLARE count INT; SELECT count(*) INTO count FROM Z4; BEGIN DECLARE cur CURSOR FOR SELECT card FROM Z4; OPEN cur; WHILE count>0 do FETCH cur INTO card; IF card=‘100‘ then INSERT INTO z3(card) VALUES(card); END IF; SET count=count-1; END WHILE; CLOSE cur; END; END; DROP FUNCTION FUN_WJF; CREATE FUNCTION fun_wjf(c CHAR(20)) RETURNs CHAR(20) LANGUAGE SQL BEGIN ATOMIC RETURN rtrim(c)||‘a‘; END
CREATE FUNCTION fun_wjf(c CHAR(20)) RETURNs CHAR(20) LANGUAGE SQL BEGIN ATOMIC RETURN rtrim(c)||‘a‘; END
SELECT fun_wjf(CARD), TRCD, AMOUNT FROM z3;
标签:
原文地址:http://www.cnblogs.com/wujf/p/5113962.html