Does TableToExcel not work on in_memory tables?

769
4
03-30-2017 07:04 AM
by Anonymous User
Not applicable

#python scripts

I have a python script that creates and populates a table that is in memory, then converts to an Excel file.

Pretty basic stuff.

When the table is an in memory table, the output excel File only has an ObjectID field.

When the table is on disk, it works fine, the output Excel file is fine.

Is this a "built in limitation" (bug)?

Thank you,

Randy McGregor

Tags (1)
0 Kudos
4 Replies
JoshuaBixby
MVP Esteemed Contributor

ArcGIS Desktop (ArcMap) or ArcGIS Pro?  What version?

I am running ArcMap 10.5, and I don't see this behavior, i.e., TableToExcel_conversion copies everything from in-memory tables.

Are you sure the in-memory table actually has more columns than ObjectID?  Could it be the issue is with the table itself and not the conversion to Excel?

by Anonymous User
Not applicable

Thanks for the reply.

I have 10.4.1. Not sure if that's it...

I tried "Copy Rows" on the in_memory table and the output was fine, had all the fields.

When I change "in_memory" to "c:\scratch\scratch.gdb" TableToExcel works fine.

I've had this problem for years actually. The solution of course is to put the intermediate table on disk, and just make sure it's a location everyone who uses the tool can access, but I'd really prefer in _memory...

0 Kudos
by Anonymous User
Not applicable

I created an in memory table and added some fields interactively in ArcGIS Desktop, and TableToExcel work fine on that, so the python script is just not "committing" this table. Maybe I need to do a "save" or something...

0 Kudos
by Anonymous User
Not applicable

This was the dreaded PEBKAC* error. I had entered the field length ("255") in the wrong location - in the "PRECISION" argument location. The LENGTH argument was blank (""). I put the length value in the correct location, and all works fine now.

*Problem exists between keyboard and chair.