Hoping I can get some help - nothing turns up on a search of the forums for this strange behaviour.
I'm well aware of how to do a parameter substation for SQL and had one successfully working, until I pointed it at another database (due to testing). The server, credentials and data structure remains exactly the same - only the DB name has changed.
I have 2 Transformations, one extracts a list of table names from a table e.g.
Code:
select distinct table_names as tablename from ABCXYZ;
tablename |
tablea1 |
tableb2 |
etc... |
The table name values are then stored as variable
tablename with a 'Copy rows to results' step.
The second transformation has the following checked:
- "Copy previous results to parameters"
- "Execute for every input row"
Parameter:
tablename, Stream column name:
tablename
I then have a 'Table Input' step which has the following SQL:
Code:
select top 10 * from ${tablename}
This transformation will still work, if I run it directly and substitute the variable on launch. However if I run the main Job - I get this error:
Code:
2016/02/11 21:21:43 - Table input 3.0 - An error occurred executing SQL:
2016/02/11 21:21:43 - Table input 3.0 - select top 10 * from ${tablename}
2016/02/11 21:21:43 - Table input 3.0 - Unrecognized SQL escape 'tablename' at line position 29.
The query works, the transformation works when I run it stand alone, and the job did work before changing the original 'ABCXYZ' database.
At this point I'm suspecting corruption or problem with Java... anyone with experience of this issue?