SQL Functions in Mobile GDB

1394
3
Jump to solution
11-16-2020 11:38 AM
Labels (2)
WalkerHenry__NIFCAdmin
New Contributor III

Does a mobile/runtime geodatabase (.geodatabase) not support all the same SQL functions as a File GDB?

I have the same data with the same label classes in a File GDB and then published to AGOL as a hosted feature service. The CHAR_LENGTH SQL function evaluates fine in each of these, but as soon as I create an offline replica (local copy/download map) from Pro, it breaks.

Hosted Feature Service:

WalkerHenry__NIFC_Admin__1-1605555428285.png



Offline Replica:

WalkerHenry__NIFC_Admin__0-1605555247478.png

Thanks,
Walker

1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

As much as SQL is standardized, it isn't.  For SQLite, the string function you want is just "LENGTH" and not "CHAR_LENGTH"

View solution in original post

0 Kudos
3 Replies
JoshuaBixby
MVP Esteemed Contributor

As much as SQL is standardized, it isn't.  For SQLite, the string function you want is just "LENGTH" and not "CHAR_LENGTH"

0 Kudos
WalkerHenry__NIFCAdmin
New Contributor III

Thanks, Joshua!

It does appear to acknowledge LENGTH, although when I go to update the expression I still get a syntax error, so I must be missing another difference with SQLite.

Either way, I need something that will be consistent in both. So I guess I'll evaluate the label with Arcade after limiting the features with SQL. Hopefully that doesn't slow things down.

I'm open to other suggestions if anyone has any.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

The syntax validators have always struggled with all the different flavors of SQL across the different DBMSs.  It isn't uncommon for me to have it say something is wrong, I hit OK and save it anyways, and then it works.

At this point I don't know enough about your workflow to comment any further.  As much as Arcade is an abomination that Esri should not have created, it is cross platform, which increases portability.  So, even I occasionally end up having to use it, albeit grudgingly.