05-15-2020 06:39 AM
Hi, I have few tables on SQL server like
abc_2020
abc_2019
abc_2018
I want to query the the table that has suffix as current year. I have specified the value
in the settings > table name-- ‘abc_’+ Date.now().getFullYear()
it’s throwing error.
Failure: Failed to retrieve metadata for table: “‘abc_’+Date”.“now()”.“getFullYear()”, Reason: Database ‘now()’ does not exist. Make sure that the name is entered correctly., Resolution: Database ‘now()’ does not exist. Make sure that the name is entered correctly.
When I hard-code the table name as abc_2020 it is working.
Can someone help me with this ?
05-19-2020 05:58 AM
Did you try to pass a table name value from the upstream mapper snap?
05-15-2020 09:10 AM
Make sure you’re toggling ‘on’ the expression icon
05-18-2020 01:16 AM
@del Yeah I am aware of that, I have toggled it before posting the query here
05-19-2020 06:21 AM
Seems like “failed to retrieve metadata” would be more about preview and the snap trying to pull and suggest fields and such for where clause, etc. Do you get this error when you actually run/execute the pipeline, or only when previewing/configuring?
05-19-2020 06:28 AM
@christwr I am getting this error when previewing and executing.