Select to view content in your preferred language

Select by Attributes in attribute table of database view

426
2
01-15-2024 12:18 AM
Status: Open
Labels (1)
Bud
by
Esteemed Contributor

ArcGIS Pro 3.2.1; mobile geodatabase and file geodatabase

 

Background (works):

In an Oracle 18c 10.7.1 EGDB, I have a database view:

--species_records_latest_no_ties_vw
select
    s.*
from
    species_records s
inner join
    (
    select
        min(objectid) as objectid,
        min(t_unique_id) as t_unique_id,
        t_species,
        max(t_date) as t_date
    from
        (select
            s.*
        from
            species_records s
        inner join
            (select
                t_species,
                max(t_date) as t_date 
            from
                species_records 
            group by
                t_species) l
            on s.t_species = l.t_species 
               and s.t_date = l.t_date
        )
    group by
        t_species
    ) l
    on s.t_unique_id = l.t_unique_id

When I add the database view to the map and open the attribute table, I can use Select By Attributes without issue.

Bud_2-1705306173437.png

 

Idea:

Could Select By Attributes functionality be added for mobile and file geodatabase views too?

 

2 Comments
Bud
by

Mobile Geodatabase:

I have the same table and the exact same database view as the Oracle view above in a mobile geodatabase. However, the Select By Attributes button is greyed out in the attribute table.

Bud_0-1705306739980.png

 

File Geodatabase:

I have the same table and near-identical database view in a file geodatabase. The only difference in the SQL is a slight difference in the field aliases. Reason: FGDB views seem to prefer slightly different syntax when it comes to those aliases.

select
    *
from
    species_records s
inner join
    (
    select
        min(objectid) as objectid,
        min(t_unique_id) as t_unique_id,
        t_species,
        max(t_date) as t_date
    from
        (select
            *
        from
            species_records
        inner join
            (select
                t_species,
                max(t_date) as t_date 
            from
                species_records 
            group by
                t_species) l
            on species_records.t_species = l.t_species 
               and species_records.t_date = l.t_date
        )
    group by
        t_species
    ) l
    on s.t_unique_id = l.t_unique_id

The Select By Attributes button is available, but it throws an error.

Bud_1-1705306740934.png

ERROR 000358: Invalid expression

 

Could Select By Attributes functionality be added for mobile and file geodatabase views too?

MarceloMarques

My 2 cents. Certain SQL operations are only available in a RDBMS (Oracle, SQL Server, PortgreSQL) because the SQL Engine behind the RDBMS that is quite complex. Certain SQL functions in a File Geodatabase might not be available and it will be difficult to implement that because of this reason. Therefore, the best approach is to move the data from the File Geodatabase to an Enterprise Geodatabase, even Mobile Geodatabase will present some limitations as well, thus move the data to an Enterprise Database (Oracle, SQL Server, PostgreSQL). I hope this helps.