ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SQL0312 error in SQLRPGLE program

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL0312 error in SQLRPGLE program

    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 ?

  • #2
    I found the issue and it is resolved. Thanks

    Comment

    Working...
    X