Skip to main content

Hello,

I have an sde database containing hundreds of feature classes, in which each feature class has an attribute containing a document reference.

I would like to be able to read the first row of attributes from each feature class so that I can check the document reference.

My current workflow uses the SQLExecutor to extract all of the feature class names. Then the names are passed to a FeatureReader to read in each feature class, with the 'Max features to read' set to '1' to save reading more attributes than required.

image.pngHowever, this is still taking a long time to process all the feature classes. Is it possible to do all of this in SQL?

Assuming the FeatureReader is the bottleneck I would use two SQLExecutors and only request the column you need.

 

First SQLExecutor to get the TableName of all tables.

select table_name as TableName from dbo.nSDE_table_registry]

Then a second SQLExecutor to get the ColumnName from the first row of each table

select top 1 OBJECTID from @Value(TableName)

If I run this on my test db, which is slow, it performs quite well.


Thanks @nielsgerrits​ that's worked perfectly.

Just for anyone that has a similar problem.

I used a second SQLExecutor to run nielgerrits SQL query, using the 'name' attribute from the first SQLExecutor in my workbench.

Probably not the most elegant or efficient solutions but gets the job done.

image


Reply