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
DB2 SQL Error: SQLCODE=-440, SQLSTATE=42884, SQLERRMC=||;FUNCTION, DRIVER=3.57.82
------解决方案--------------------------------------------------------
SET MYSQL = 'SELECT COUNT(*) INTO '