SQLCODE -104 while preparing statement in SQL . Eval Sqlstmt1= 'Insert Into' + ' ' +
%Trim(WRKTLIBR) +'/' +%Trim(WRKFILE) +
' '+'(Select * from '+ %Trim(WRKLIBR) +
'/' + %Trim(WRKFILE) + ' ' + 'A' + ' '
+ 'Where Exists (Select * from CSTBYUNQL1 B '
+' Where B.Compny = A.' +%Trim(WRKCMP)
+ ' and '+
'B.Customer# = A.' +%Trim(WRKCST) +' and '+
'SUBSTR(LIBRARY,7,4) = ''' + %trim(WRKFRLB)+
Please let me know all possible reasons, Interactively running this query getting executed, then I tried with Exec it isa executed. The scenario is for one record I'm getting this error for another I'm getting SQLcode as 100. Need help urgently.