Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_TALLY returns a 0 on a INSERT command
Message
From
23/08/2007 08:36:15
 
 
To
22/08/2007 22:37:53
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Vista
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01249694
Message ID:
01249807
Views:
16
>>I never noticed this, but is now in the way. When I issue a INSERT command the _TALLY reports zero record affected when in fact it should be 1.
>>
>>
>>CREATE CURSOR test (name c(10))
>>INSERT INTO test VALUES ("test")
>>? _tally
>>
>>
>>Help indicates that it should return 1.
>>
>>Is my wrong here?
>
>I don't know whether this is related, but after doing a REPLACE ... which must have affected hundreds of records, _tally was equal to 1. While I didn't investigate this case thoroughly, I figured that the auditing function which gets triggered from nearly every table resets the _tally. Probably I will have to correct it so that it saves the _tally value before writing to the audit table, and restores after that.
>
>In other words, check if no additional function gets triggered by the INSERT command.

I discovered this problem while writing unit test for my Query tool. The Insert statement being executed is a simple SQL statement. The _TALLY variable appear to never get set rather then be reset to zero. If I set the _Tally variable to are known value and execute a insert statement, the variable retains its original value.

I have worked a workaround, as ugly as it is, that calculates the number of records inserted. It is my understanding that this iswhat the _tally variable is suppost to have returned.
Greg Reichert
Previous
Reply
Map
View

Click here to load this message in the networking platform