How to use table name dynamically in SQL Query to populate Data Log of Data Source?
- 7 years ago
1) set up your 2 properties schemaName and tableName .. you can do this at this test case level, the testsuite level or the project level. (Highlight the testCase/testSuite / project in the left panel. If the properties window pane does not display below this panel, click View / Properties from the menu. Click on the "Custom Properties" tab in the properties window pane. Click the green plus sign to add the property, give it a name and a value.)
2) once the properties are set up ... go back to the SQL Query window in your screen shot and right click. This should bring up the 'Get Data' window. Select the properties that you want to use in your SQL query. - 7 years ago
I think that you are missing the single quotes around the #TestCase#testCaseName ... without the quotes, I believe SQL thinks it is a column name.
WHERE DATA_SCENARIO LIKE CONCAT(A,'%') - without the single quotes around A SQL is looking for column A
WHERE DATA_SCENARIO LIKE CONCAT('A','%') - I think this is what you want ... so the two strings will be concatenated.
so maybe this will work ?
WHERE DATA_SCENARIO LIKE CONCAT(''',${#TestCase#testCaseName},''','%')
Hope that helps. Not a SQL expert!