Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append From Data Not There

Status
Not open for further replies.

NoWayIsThisInUse

IS-IT--Management
Jul 16, 2002
79
US
Is there a bug in VFP 8 whereby on an "ppend from &tabname" character fields don't always come over?

I've been programming in dBase/Foxpro since dBase II (20 years), so I've got the t-shirt -- but I have been programming in ColdFusion primarily for the last few years, so I'm hoping I missed a memo.

tabname = "mytable"
select tmpTable
append from &tabname
I've done a "flush" afterwards, with no change.

Browse it and some character fields are empty... It works most of the time and then will not sometimes on one in every 20 times.

So I said "fine, I'll do it another way" and did a select * from &mytable into table tmptable and browsed it and it gives very similar results, if not worse.

Any ideas?
 
What are the respective table structures of tmpTable and mytable? Is myTable really a .DBF on disk? What software created myTable.DBF?

Rick
 
I don't know of any bug that would explain this. APPEND FROM hasn't really changed since dBASE days, and your code looks OK.

When you say it goes wrong one time in 20, do you mean one record in 20, or one time in 20 that you execute the command? If the former, is there anything special about the field that it is not picking up?

If the latter, are you sure the name of the field in question is identical? If it's not, the field won't come across.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Yes, both structures are exactly the same. And certainly that is the case when using the "Select * from &tabname into table tmpTable".
The tables themselves are denormalized and therefore have names such as "Shift_nm1", "Shift_nm2"... up to "Shift_nm7" and each having 30 characters. The fields that come over as blank do so only on records that have been changed. The source table is not even in use and when you look at it, all field information exists.
Do you think it has something to do with the macro substitution for the table name? Really, it's like the new data hasn't been flushed to disk in the source table yet.
 
Could buffering be the issue? Have you tried TABLEUPDATE() as well as FLUSH?

Regards,

Mike
 
Thanks all for your help. It turns out that there is nothing wrong ith Fox at all and that it was me. Imagine that! There was a routine I failed to see that occurred after it in the code.
I'm an idiot, but at least I have 20 years experience. What a humbling profession.
 
None are so blind as those who fail to see.

Been there, done that. Glad you got it working.

Regards,

Mike
 
You can copy deleted records to a new table if you have SET DELETED OFF but if you append into the current table with SET DELETED OFF then all the records including the deleted records will append but the deleted flag is cleared for the deleted records. In effect, they will have been recalled, so to speak, not in their original table which remains unchanged, but in the table you appended them into. That append behavior has confused me more than once.

dbMark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top