We need virtual, ad hoc SQL columns in the attribute table.
Think of a field calculation, but it’s a dynamic, temporary, read-only mechanism used for one-off tabular data analysis. Takes advantage of the power of SQL; should be as easy to set up as definition queries.
The field would be set up in the feature layer properties, not as a persistent field or as a persistent object in the database. Allows editing FC fields in the same attribute table. Avoids the need to create a clunky query layer or view and then join it back to the FC. No exclusive locks or privileges required other than SELECT.
Examples:
Existing mechanisms aren’t suitable:
Fast performance could be achieved by:
Building the calculated column right into the main SELECT query that is sent to the database, not as a self-join which is less efficient.
Example:
select
objectid, --FC field
asset_id, --FC field
class, --FC field
case when class='A' then 1 end as class_flag --Calculated column
from
roads
Thanks for the Idea @Bud,
This seems very similar to the idea linked below. Let me know if you think this its a match and I'll merge them.
Link - Allow support for virtual / computed fields in Oracle/SQL Server versioned geodatabases
@SSWoodward As far as I know, that other idea pertains to columns that are defined in the database table DDL:
create table t1 ( id number, product varchar2(50), price number(10,2), price_with_tax number(10,2) generated always as (round(price*1.2,2)) virtual );
https://oracle-base.com/articles/11g/virtual-columns-11gr1
Those columns are called Computed Columns (SQL Server) and Virtual Columns (Oracle and PostgreSQL).
Whereas the Virtual Attributes (ad hoc) idea above is for an ArcGIS Pro mechanism in the attribute table that only exists temporarily in a feature layer in the map document.
You can use native database feautures that can be leveraged to help with this, the first thing that comes to mind is Database Materialized Views for large datasets and it is also possible to modify an existing view directly in the database using SQL statements, hence you do not need to use ArcGIS to drop / recreate the view. I hope this helps.
Examples:
An Essential Guide to Oracle Virtual Column By Practical Examples (oracletutorial.com)
@MarceloMarques Thanks, however I don’t really consider materialized views to be suitable for ad hoc calculations for fast-paced data analysis work. Materialized views need to be set up by the DBA, since CREATE MATERIALIZED VIEW privileges are not included in the Oracle Data Creator user type. So in my case, getting the DBA to set up a MV requires an official project request. So we’re talking years, whereas I’m looking for a temporary solution that can be set up in seconds, similar to a definition query.
Regarding virtual columns in Oracle tables, my understanding is virtual columns aren’t supported by ArcGIS. And virtual columns aren’t meant for one-off data analysis calculations. Instead, they’re a persistent column in the underlying database table.
Regarding modifying a database view using a SQL client (not possible for file geodatabase views):
Yes, that can be helpful in some cases. I do it regularly. But it can cause problems if the view is registered with the geodatabase. And database views have other limitations, as mentioned above.
It's too bad this idea is currently in a status that disallows upvotes. It seemed to get a bit of traction initially before it was changed to Needs Clarification.
Maybe people can comment instead to show their support (like rburke did). That way notifications about the post would be a reminder to come back and upvote when the status changes.
@Bud agree, the lockout on upvotes when the status is anything other than 'open' serves to cut traction when it's most likely to get it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.