Select to view content in your preferred language

Preserving a MySql datetime field in Python

2388
12
02-13-2020 07:47 AM
JoeBorgione
MVP Emeritus

I have a python script that extracts data from a MySql database and writes it to a csv.  The original table is a mix of all sorts of field types including datetime and timestamp.  Once the csv is written and I perform an an arcpy table to table to get it into a fgdb, the datetime fields automagically become text fields.  Not so good if you need to filter by date....

CSV files are both a boon and bane: is there a way to go right from MySql to a File geodatabse, thus preserving the field types?  Unfortunately I do not have admin rights to our e-gdb (Sql server back-end) so I can't go MySql to SqlServer....

That should just about do it....
Tags (2)
12 Replies
JoeBorgione
MVP Emeritus

I've got a couple of humongous databases to plow through.  It just might save not only time, but my sanity!

That should just about do it....
0 Kudos
JoeBorgione
MVP Emeritus

Hey Bruce Harold   I just went to the ArcGIS Interoperabilty page, clicked on the Learn More link and it sent me to an ArcGIS Help 10.2, 20.21, and 10.2.2 page....  

That should just about do it....
0 Kudos
BruceHarold
Esri Regular Contributor

Oh my word, a doc bug!  Thanks for reporting it, I'll send it on.

Data Interoperability is an extension like Network Analyst, Spatial Analyst etc., you can evaluate it at no cost.

0 Kudos