Database.GetQueryDescription returns the wrong table

04-05-2019 07:18 AM
New Contributor II

Hello to everybody!!

I'm using ArcGIS Pro version 2.3.2 and ArcGIS PRO SDK version to create a CIMSqlQueryDataConnection to be used in the creation of a FeatureLayer. The data are stored in a PostGIS database, the DB contains two schema named schema1 and schema2, inside those schemas I have placed two table with the same name so that we have:




| |_table




When I invoke GetQueryDescription("PostGISDB.schema1.table") using the fully qualified name of the table the function returns the information related to the table "PostGISDB.schema2.table" instead of the information related to "PostGISDB.schema1.table"

Any hint?

0 Kudos
2 Replies
Esri Regular Contributor

Hi Mario,

How did you connect to the Database in the first place?  Does the username that you used have access to schema1?  When you call Database.GetTableNames(), do both tables appear in the returned list?



0 Kudos
New Contributor II

Sorry for my delayed answer, I'm using the following code to connect to the Dabase:

this.databaseConnectionProperties = new DatabaseConnectionProperties(EnterpriseDatabaseType.PostgreSQL)
AuthenticationMode = AuthenticationMode.DBMS,
Database = databaseName,
User = userID,
Password = password,
Instance = host

this.database = new Database(this.databaseConnectionProperties);

The user has access to both the schemas and both the tables are returned by Database.GetTableNames(),

0 Kudos