请高手指点,在动态sql语句中不能用宿主变量吗?我现在想执行一个sql语句,是这样的:
sprintf(strwasten, "select count(entime) into :aa from t%s_enwaste0%d",orgcode[i].org_name,mon-1);
EXEC SQL EXECUTE immediate :strwasten;
但是提示是:DBERR : select count(entime) into :aa from. SQLCODE : -312
REASO : SQL0312N The host variable "aa" is used in a dynamic SQL statement, a view
definition, or a trigger definition. SQLSTATE=42618
------解决方案--------------------------------------------------------
你这样是表示直接执行sql语句吧,,当然不允许了,用游标吧