The content of dyn_sql.txt:
INSERT INTO PRAGMATEMP.RELACION_ACCION_TMP (DENOMINACION_CENTRAL,DENOMINACION_RELACION,ESPECI ALIDAD_CENTRAL, ESTADO_RELACION,ID_RELACION,NRO_RELACION_CENTRAL,S ELECCIONADO,TIPO_RELACION,USUARIO) SELECT MRC.DENOMINACION, MR.DENOMINACION, MRC.ESPECIALIDAD_ID, MR.ESTADO_RELACION, MR.ID, MRC.ID, 0 , MR.TIPO_RELACION, CAST(? AS VARCHAR(255)) FROM MINIMART.RELACION MR LEFT JOIN MINIMART.RELACION MRC ON MR.CENTRAL_ID = MRC.ID WHERE MR.ESPECIALIDAD_ID = ? AND MR.FILIAL_ID = ?;
Later, i execute this command line:
db2inst1@arrosdb202:~> db2 -tf dyn_sql.txt
and the output is this:
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0313N The number of host variables in the EXECUTE or OPEN statement is not
equal to the number of values required. SQLSTATE=07004