I would like to select only tables with certain strings in their table names when running a FeatureReader. So something akin to:
WHERE TABLE_NAME LIKE '%searchstring%'
Is this doable? And if so, how?
I would like to select only tables with certain strings in their table names when running a FeatureReader. So something akin to:
WHERE TABLE_NAME LIKE '%searchstring%'
Is this doable? And if so, how?
You can insert an SQLExecutor before the FeatureReader to query the database metadata tables. This depends on the database implementation, but for SQL Server it might look like this:
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND TABLE_CATALOG='MySchema'
AND TABLE_NAME LIKE '%searchstring%'
You could then pass the resulting attribute TABLE_NAME to the FeatureReader.
Thanks!
And should anyone ever need to do this treatment on a geopackage file the syntax is:
SELECT TABLE_NAME
FROM GPKG_CONTENTS
WHERE TABLE_NAME LIKE '%yoursearchstring%'
One also needs to repeat the above in the 'attributes to expose field' to give the FeatureReader something to chew on.
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.