Hello again, colleagues, I have a problem executing gp.merge_management or gp.merge tool within a script. My script needs to merge a varying number of tables together. In this instance there are 7, though this number can and will change. In order to accomplish this I have used various different scripting techniques, all of which have failed. I feel like I am so close and it should work, but there is something fishy stopping it, that I just can�??t see. The error I continually get is: #ERROR 000582: Error occurred during execution.
Error code: 000582: Error occurred during execution.
Description: An error occurred during the tool's validation or execution. No specific messages were available.
The validation process checks that a tool's set of parameter values are of the expected number, data type, and value.
Solution: Check that a tool's required parameter values are specified and are the correct data type. If the parameters are entered correctly, it may be possible the execute routine for the tool is invalid. Have the developer of the custom tool check the Execute implementation.
See: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?tocVisable=1&ID=-1&TopicName=tool%20errors%20and%20warnings:576-600&pid=1Please see my attached code:
Stage2Tbl = r"E:\\FMP_Reports_Tool\\tempWS\\Stage2Tbl"
try:
mergeString = r""
for tbl in mlist:
mergeString = mergeString + tempWS + tbl + ";"
insertStr = mergeString.rstrip(";")
gp.Merge_management(str(insertStr), Stage2Tbl, "")
except:
# Get the geoprocessing error messages
msgs = gp.GetMessage(0)
msgs += gp.GetMessages(2)
# Return gp error messages for use with a script tool
gp.AddError(msgs)
# Print gp error messages for use in Python/PythonWin
print msgs
The variable mlist is a list that contains the output names of tables that were created into the temp workspace earlier in the script. This list is then used to select those same tables, and merge them back together. - I create the mergeString variable from the mlist , to be used in the actual gp.merge tool.
- I was concerned that there may be a problem reading the workspace strings in the mergeString, so I added the �??r�?� to create a raw string. This had no effect.
- I read previously in another thread that I might need to convert my string, to string within the actual tool. I added this but had again the same result.
- I used my string variable insertStr in the merge tool of a separate script and it worked just fine! So it just will not work here.
Please, are there any suggestions on anything further I should try or other methods which might work in this circumstance? I am using ArcInfo 9.3 and python 2.5 if that helps.Thanks!- JamesPs. This is worth at least 3 Stars on the old forums...