DB2 ErrorCode 440,求解!
CREATE PROCEDURE "JUNIPER"."TEST_LMD"
()
LANGUAGE SQL
SPECIFIC SQL120601092005600
BEGIN
DECLARE TBL VARCHAR(20) DEFAULT 'ALMD';
DECLARE MYSQL VARCHAR(200) default '';
DECLARE CREATESQL VARCHAR(200) DEFAULT 'CREATE TABLE AAALMD LIKE ALMD';
DECLARE DATACNT integer default 0;
SET MYSQL = 'SELECT COUNT(*) INTO '||DATACNT||' FROM '||TBL;
EXECUTE IMMEDIATE MYSQL; -- 这里报错了!
IF(DATACNT>0)
THEN
EXECUTE IMMEDIATE CREATESQL;
COMMIT;
END IF;
END