views:

319

answers:

2

Hello,

In Microsoft SQL I can use the GETDATE() function as the default value for a DATETIME field. I'd like to be able to do the same kind of thing for a date field in an ArcGIS geodatabase. Is this possible, or am I limited to literal values?

My geodatabase is using ArcSDE 9.1. The Feature Class with the defining attributes is versioned.

Thanks,

Camel

+1  A: 

ArcGIS generally leverages an external database engine, so unless you are talking about an individual shapefile, your data is being stored in Access, SQL Server, or Oracle. Unless you have ArcSDE, it is probably Access. You can define data directly in the database and assign defaults there and then link to the tables from your map authoring tool.

EDIT After your last comment I consulted with one of my more GIS savvy friends and she had the following to offer

they will have to define the table and its defaults in the database and then join the table to the feature class via a common field. It is important not to join the date field to the feature class, in that case, the feature class would hold onto the values set up in the feature class and ignore the table value.

Hope that is of some help.

cmsjr
Thanks. As it turns out, we have ArcSDE and the Feature Class is versioned. Based on testing - the versioned tables don't copy the defaults I setup in my defining table.
Camel
A: 

I ended up talking to Esri support about this issue. They confirmed that versioned tables do not inherit the default values of the original table (well, in SQL Server anyway).

With regards to creating a join between a table and the feature class:

  • The data is exported to a shape file and copied to a PocketPC device
  • Data entry is via an ArcPad application
  • The shape file is synchronised and re-imported into the SDE

So basically, the DATETIME default would have to survive the export/import process. I didn't test whether this is possible. In the end, I inserted the default value programmatically on the PocketPC.

Camel