|
POST
|
Hi there Sorry I rewrote my message when I read though it again. It seems I can call something else but I don't do it in the same place as the error exception handling, In PL/SQL I could call a procedure a raise but in Python, you call an exception and then do something else after the exception has been called. So they are separate parts of code. Kind regards Tim
... View more
09-26-2011
04:28 AM
|
0
|
0
|
2790
|
|
POST
|
Hi there I've read through various web sites and Stacys helpful reply. However if I implement Stacys code then only an error message is displayed. However whilst I need an error message, I also need some code to run that brings up the map services after the error message is displayed or just before, if it can't be after. I've got the code to bring up the map services but I am not sure how I call this via an exception as all the exceptions I've seen, seem to just print an error message and do nothing else afterwards. I know how to do this in PL/SQL but this is different way of working to that and I can't figure it out. Kind regards Tim
... View more
09-26-2011
04:25 AM
|
0
|
0
|
2790
|
|
POST
|
Thanks for your reply Stacy. I will study what you have written closely. I'm trying to handle all my exceptions in their own procedure. So each type of error goes to the procedure, which is a standard procedure that prints an error message and then restarts all the map services. I'm not 100% certain how the class and def __init__ works. I've seen various bits of code but I guess the issue is I don't understand what __init__ means theoretically for Python and thus I don't understand how to use it. Lots of places give the theoretical code for exceptions and then an example but not necessarily the meaning behind the code. However I'm now browsing the term __init__ and that should greatly help me. I wasn't expecting to get into this area so quickly. I'll probably buy a book on python but right now I don't have time to wait for one to turn up. Would be great if ESRI published one. The section in ModelBuilder is far to short. They need something like the Apress book for Oracle Spatial, which I own and found extremely useful when completing my masters dissertation. Expect when I wanted to add an obsolete Ordnance Survey project into Oracle that is...... Kind regards Tim
... View more
09-26-2011
01:09 AM
|
0
|
0
|
2790
|
|
POST
|
Hi there I'm attempting to run a script in Python 2.6 referencing ArcGIS 10. I got the script to run but then I decided to use the try and except method and handle multiple exceptions. However as soon as I started doing this I'm getting the following error: except EXCEPTION:
NameError: global name 'EXCEPTION' is not defined I think I need to define a class but I'm not sure how that would relate to then running an additional procedure. The idea of the programme is to create a backup of 3 feature classes and if errors occur, pass them to the error exception procedure. This then prints an error message and calls the procedure to restart the map services. The section of code is as follows: print "\n5. Now renameing " + TABLE_OWNER + SDE_FC_CURRENT + " to " + TABLE_OWNER + SDE_FC_BACKUP + " providing no lock exists"
try:
try:
if arcpy.Exists(TABLE_OWNER + SDE_FC_CURRENT) ==1:
arcpy.Rename_management (TABLE_OWNER + SDE_FC_CURRENT,
TABLE_OWNER + SDE_FC_BACKUP)
print "test " + EXCEPTION
except EXCEPTION:
if arcpy.TestSchemaLock(TABLE_OWNER + SDE_FC_CURRENT) ==0:
EXCEPTION(LOCK_ERROR_TEXT, SDE_FC_CURRENT)
except LOCK_ON_BACKUP:
if arcpy.TestSchemaLock(TABLE_OWNER + SDE_FC_BACKUP) ==0:
EXCEPTION(LOCK_ERROR_TEXT, SDE_FC_BACKUP)
except UNKNOWN_ERROR2:
if arcpy.Exists(TABLE_OWNER + SDE_FC_CURRENT) ==0:
EXCEPTION(UNKNOWN_ERROR, SDE_FC_CURRENT + " and " + SDE_FC_BACKUP)
I hope that is enough code. I can supply more if required. Kind regards Tim
... View more
09-23-2011
07:38 AM
|
0
|
8
|
6395
|
|
POST
|
Hi Tim, If changes need to be tracked over time, a feature class must be registered as versioned without the option of moving edits to base and archiving must be enabled. If archiving is not enabled, one cannot connect to a historical version to track the changes. Please review the following help links and verify if it paints a clearer picture. Enable archiving ------------------- http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//0093000015z6000000 Disable archiving ------------------ http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#/Disabling_archiving/0093000015z7000000/ Thanks Thank you for your reply. I have already registered the tables as versioned without moving the edits to base so the archive could be enabled. I read the two help documents but they make no reference to feature class to feature class copying with regards to archiving, which is what I am trying to figure out. Would archiving achieve a similar result to creating a back up? Although the database itself gets backed up, I am wishing to have a day old backup of the table encase the table corrupts. As this is easier to get hold of. Could a table corrupting cause an archive to corrupt more easily than a day old back up? I am going to raise a support call with ESRI UK and I when I get a moment I will post back what they suggest and/or say. Kind regards Tim
... View more
09-23-2011
12:57 AM
|
0
|
0
|
1037
|
|
POST
|
Hi there I am using ArcMap 10.0.2 connected to ArcSDE 9.3.1, with the database hosted in Oracle 9i. I have a feature class which is registered as version with no edits moved to base. This is so I can track it over time. If I then do a feature class to feature class conversion, in order to create a backup, will it still contain the same history, as in archiving? The current logic is like this: 1. Using feature class to feature class, Take current <feature class name> and generate one with the name <feature class>_new 2. rename current <feature class name> to <feature class name> backup 3. rename <feature class name>_new to <feature class name> 4. Register <feature class name> as versioned Kind regards Tim
... View more
09-22-2011
06:40 AM
|
0
|
4
|
1476
|