I have tried to convert tabletotable in arcpy, while in the process the conversion got failed/interrupted. When I run the command again, it says cannot create csv file. When I checked the schema file got locked.
arcpy.TestSchemaLock.
How to release schemalock/database lock in arcgis pro.
Not able to do Lock view in arcgis pro.
Thank you
Easwar
Hello @EaswarA
If your data is in a File Geodatabase, you can try releasing a Lock using by Compact or by using Windows Explorer, like this :
If your data is in an Enterprise Geodatabase, you can try releasing the Lock using the Geodatabase Administration, Locks table. Note, you will need to connect as the Geodatabase Administrator in order to do this.
Thanks Chris,
I don't have Compact installed/approved software to use. Can you please guide me how to delete it from windows location.
Thank you
Easwar
Hello @EaswarA The Compact tool is in the ArcGIS Pro Toolbox, you can just search for it.
If that does not help, please provide some details about what you are doing, and what you are seeing, to lead you to believe you are seeing some Locking problems.
Thanks for sharing the screenshot. Tried to run the compact , but It doesn't help in removing lock.
It runs only compact process.
Let me clarify you with more details.
I am completely newbie to arcgis pro tool, in my project we are creating file geodatabase with new tool and we want to compare all the featureclass table data with the legacy file.
So here I am converting the featureclass to csv file using arcpy.conversion.TableToTable(featurefile, outputfile.csv)
The same command was working before, during my last run it got failed due to same filename and I have changed the filename and try to again and it started throwing the below error.
arcgisscripting.ExecuteError: Error 000210 cannot create output D:\users\output.csv.
Tried changing the output location too, but still showing same error.
Then checked the featureclass is there any schemalocl.
Ran below python command to check the schemalock
arcpy.Testschemalocl(featureclass)
it returns True
Hope this gives complete issue on my problem I am facing.
Thanks again,
Easwar
Hello @EaswarA , according to the documentation, the TableToTable function requires 3 parameters, not 2.
https://pro.arcgis.com/en/pro-app/3.1/tool-reference/conversion/table-to-table.htm
arcpy.conversion.TableToTable(in_rows, out_path, out_name)
Note, this is a deprecated tool. This functionality has been replaced by the Export Table tool.
Yes @ChrisUnderwood ,I am giving all three parameters in below function. Sorry I mentioned it wrongly in my last thread.
arcpy.conversion.TableToTable(in_rows(feature), out_path(folder location), out_name(filename.csv))
And I am using arcgis pro 2.9.2 version . I want to do it as part of Python script to automatically convert to CSV file for comparison.
arpcy.conversion.ExportTable() is not showing in python module.
Even with a Schema Lock in place, the TableToTable can still create the output .CSV file. I don't think your problem is with Locking on the source Table, I think it is with the output file or location.
arcpy.TestSchemaLock("C:\SUPPORT\MyFGDB.gdb\MyTable")
True
arcpy.conversion.TableToTable(
"C:\SUPPORT\MyFGDB.gdb\MyTable",
"C:\SUPPORT\Community",
"MyFilename.csv")
<Result 'C:\\SUPPORT\\Community\\MyFilename.csv'>
Adding to the above point, I don't see any lock file in arcgis pro folder location or in my file geodatabase folder location.