Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Uniqueness of Index problem - can't see how it could hap
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00689229
Message ID:
00689231
Views:
27
Do you have !DELETED() filter on the unique index?

>On the code below, which ran against 600 rows in the curresult table, for one entry, I received the error: Uniqueness of index xitemno will be violated
>I can't see how this error could happen in this context. Maybe I am overlooking something simple, or there is some simple logic error (I was up late last night!), but I can't see how it could happen unless the seek failed erroneously. This code was running on my test machine, in a standalone environment. I can see how it would happen in a multiuser environment, but not here.
>(See notes in code below)
>
>Thanks in advance for any suggestions.
>
>
>
>Case alltrim(curResult.tablename)=='icitem'
>	Select 0
>	Use (curResult.tablename)
>
>	** find the original item
>	If seek(lcolditemno,'icitem', 'xitemno')
>
>		lnrecpointer=recno('icitem')
>		** see if the new item exists already
>		If not seek(lcnewitemno,'icitem', 'xitemno')
>			** if the new item doesn't exist already,
>			*go back to the original, and
>			**change the old to the new
>			Goto lnrecpointer in icitem
>
>                        *** got error message here on this replace. I have
>                        *** looked at this code a million times, and
>                        ** can not figure out how it could fail
>                        ** unless the seek failed when it really should not
>                        **have
>			Replace icitem.citemno with lcnewitemno in icitem
>		Else
>			Wait wind 'Item ' + lcnewitemno +  ;
>                        ' already exists    in icitem ' + chr(13) + ;
>				'Item ' + lcolditemno + ' will be ' + ;
>                         ' replaced  with ' + lcnewitemno + ;
>				' in transaction detail lines, and ' +
>                                 lcolditemno + ;
>				' will be deleted from   the icitem
>                                 table '   nowait
>			Goto lnrecpointer in icitem
>			Delete in icitem
>		Endif
>	Else
>		Wait wind 'Error: original item not found in change list -
>                skipping ' nowait
>	Endif
>	Use in icitem
>
>
>
>
- Jayesh
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform