Dcl-S SqlStmt Varchar(1000);
Dcl-S Kyear Char(4);
Dcl-S KMn Char(2);
Dcl-Pi REFRESHRPG;
LibName Char(10);
Date Char(8);
End-Pi;
Kyear = %Dec(%Subst(Date:1:4):4:0);
KMn = %Dec(%Subst(Date:5:2):2:0);
SqlStmt = 'INSERT INTO LIB_A/FileNameA '+
'SELECT * from '+ %Trim(LibName) + '/FilenameB' ;
Exec Sql
Execute Immediate :SqlStmt;
From above code I am getting error
SQL0312 - Variable SQLSTMT not defined or not usable
I don't know what is wrong here. Can any one help me ?
Dcl-S Kyear Char(4);
Dcl-S KMn Char(2);
Dcl-Pi REFRESHRPG;
LibName Char(10);
Date Char(8);
End-Pi;
Kyear = %Dec(%Subst(Date:1:4):4:0);
KMn = %Dec(%Subst(Date:5:2):2:0);
SqlStmt = 'INSERT INTO LIB_A/FileNameA '+
'SELECT * from '+ %Trim(LibName) + '/FilenameB' ;
Exec Sql
Execute Immediate :SqlStmt;
From above code I am getting error
SQL0312 - Variable SQLSTMT not defined or not usable
I don't know what is wrong here. Can any one help me ?
Comment