Select to view content in your preferred language

Mobile GDB database view — Treat aggregated field as date

422
1
01-12-2024 06:03 PM
Status: Open
Labels (1)
Bud
by
Esteemed Contributor

ArcGIS Pro 3.2.1; mobile geodatabase


I have a mobile geodatabase standalone table called SPECIES_RECORDS that has a date field:

Bud_0-1705110206113.png

Bud_1-1705110235783.png

I've created a simple SELECT * view on the table:

--species_records_vw
select * from species_records

That view displays the date correctly in the attribute table. Good.

Bud_5-1705111173090.png

Bud_0-1705111644948.png

However, with a more complex view, like a view that aggregates rows using GROUP BY, the date field is not displayed as a date. It's displayed as a DOUBLE.

--latest_vw
select min(objectid) as objectid, t_species, max(t_date) as t_date from species_records group by t_species

Bud_3-1705110786049.png

Bud_4-1705110814547.png

I don't have that problem with an equivalent aggregation database view (exact same data) in a file geodatabase or an Oracle enterprise geodatabase.

Could mobile geodatabases be enhanced to display date fields in aggregated database views as dates too?

 

 

1 Comment
MarceloMarques

Each rdbms shall allow you to define the column type in the view. See examples below. You will need to search the rdbms documentation for more examples.

t sql - Can I specify column types when creating an SQL Server view? - Stack Overflow
sql - How to change a column data type in Oracle View? - Stack Overflow

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 aproach 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.