SQLConnection.GetColumnNames doesn't consider selected schema
Posted: 30.01.2023, 14:10
Hello,
I realized that by simply calling SQLConnection.GetColumnNames('MYTABLE', 'MYCOLUMN', sl) returns multiple results from different schemas. If I use the other overload and specify SQLConnection.Catalog as the first parameter (schema pattern) only one row is returned as expected, as I have a schema set on the connection.
The reason is, the first variant simply calls the other overload without a schema name. Therefore, ZDbcOracleMetadata : 1916 (TZOracleDatabaseMetadata.UncachedGetColumns) returns an empty string for OwnerCondition and therefore no filtering will be done.
There was a similar fix of mine a while ago (Merged revision(s) 7301 from trunk: By AEHimself: ZStoredProc "Cannot retrieve resultset" with multiple schemas / catalogs fix), so my question is, is this intentional, or metadata should consider the schema set on it's connection?
If it should, should I correct it on the level of TZAbstractConnection, or in TZOracleDatabaseMetadata (as there is a huge chaos in usage of terms "catalog" and "schema" across different RDBMS systems).
I realized that by simply calling SQLConnection.GetColumnNames('MYTABLE', 'MYCOLUMN', sl) returns multiple results from different schemas. If I use the other overload and specify SQLConnection.Catalog as the first parameter (schema pattern) only one row is returned as expected, as I have a schema set on the connection.
The reason is, the first variant simply calls the other overload without a schema name. Therefore, ZDbcOracleMetadata : 1916 (TZOracleDatabaseMetadata.UncachedGetColumns) returns an empty string for OwnerCondition and therefore no filtering will be done.
There was a similar fix of mine a while ago (Merged revision(s) 7301 from trunk: By AEHimself: ZStoredProc "Cannot retrieve resultset" with multiple schemas / catalogs fix), so my question is, is this intentional, or metadata should consider the schema set on it's connection?
If it should, should I correct it on the level of TZAbstractConnection, or in TZOracleDatabaseMetadata (as there is a huge chaos in usage of terms "catalog" and "schema" across different RDBMS systems).