"INNER JOIN rdb$index_segments idx ON idx.rdb$index_name = rc.rdb$index_name " +
"INNER JOIN rdb$relation_fields rf ON rf.rdb$field_name = idx.rdb$field_name " +
"    AND rf.rdb$relation_name = rc.rdb$relation_name " +
"INNER JOIN rdb$fields f ON f.rdb$field_name = rf.rdb$field_source " +
"WHERE " +
<BUG>"CAST(rc.rdb$relation_name AS VARCHAR(40)) = ? " +
</BUG>
"AND rc.rdb$constraint_type = 'PRIMARY KEY'";
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable)
throws SQLException {

"INNER JOIN rdb$index_segments idx ON idx.rdb$index_name = rc.rdb$index_name " +
"INNER JOIN rdb$relation_fields rf ON rf.rdb$field_name = idx.rdb$field_name " +
"    AND rf.rdb$relation_name = rc.rdb$relation_name " +
"INNER JOIN rdb$fields f ON f.rdb$field_name = rf.rdb$field_source " +
"WHERE " +
"CAST(rc.rdb$relation_name AS VARCHAR(" + (OBJECT_NAME_LENGTH + 10) + ")) = ? " +
"AND rc.rdb$constraint_type = 'PRIMARY KEY'";
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable)
throws SQLException {
