Subject |
Re: xdml append from problem |
From |
charlie <tm@tc.com> |
Date |
Thu, 29 Aug 2024 14:21:28 -0400 |
Newsgroups |
dbase.getting-started |
I am wondering if this could be a bug of some sort with append from. Very frustrating.
I have tested this on two different computers with a very simple program
use table1
append from table2 for empty(sku) (does same thing with or without 'for'.
return
I have found this appends the top record in table2 once. But if you leave that record in table1 and try it a second tine it fails to append anything. It is like the one record that appends blocks any other records.
I have double checked the data that does append and I can find nothing wrong with it.
Does this ring a bell at all?
Charlie Wrote:
> Thanks for the info Akshat...
>
> I have since done some work on this in making sure the field names match the table i am trying to append to. I also now have them in the exact order. But the append to table has 5 fields extra which are at the end of the table. Is it possible that I have to add 5 blank fields with headers to the append from table? I don't think that is the case but i could be wrong.
>
>
> Akshat Kapoor Wrote:
>
> > Good Morning Charlie,
> >
> > > I know this is dated but I am having a problem with the append from statement. It seems to only append one record. The append is at the bottom of the code. I am wondering if possibly the code i am using toward the top from mervyn might be affecting this somehow.
> > >
> > > Your code works perfect Mervyn but i am wondering if it could be affecting append. Or possibly I am making a stupid error of some kind.
> > >
> > > Any help will be very much appreciated.
> > >
> > > set procedure to append_from_csv.prg
> > > try
> > > append_from_csv(_app.folder3+'csvrec.dbf','&pth1','d',true)
> > > catch (exception e)
> > > msgbox( "Abort import. File must be CSV format with correct 12 columns." )
> > > return
> > > endtry
> > > use csvrec
> > > count to cnt
> > > if cnt < 1
> > > msgbox( "There there are 0 rows. Cannot proceed." )
> > > return
> > > endif
> > > msgbox( "CSV file successfully imported." )
> > > else
> > > msgbox( "Import aborted." )
> > > endif
> > > set filter to
> > > use csvrec
> >
> > I have not used this piece of code so will not comment on that but I
> > would check the number of rows appended here before deleting any rows.
> > my xdml is a slightly rusty so check for errors.
> >
> > Count all to temp
> > ?temp, [rows in the table]
> > > delete for empty(id) or empty(country)
> > > replace all id with upper(id)
> > > replace all category with upper(category)
> > > replace all grade with upper(grade)
> > > replace all location with upper(location)
> > > replace all country with upper(country)
> > > replace all metal with upper(metal)
> > > replace all mintage with upper(mintage)
> > > replace all details with upper(details)
> > > sele a
> > > use memo
> > > nsk = newsku
> > > sele b
> > > use country
> > > sele c
> > > use collection
> > > go top
> > > append from :coindata:csvrec.dbf// for not empty(id)
> > >
> > > I tested this with a message box and it always indicates one record was appended ( out of 13) on my last try.
> >
> > It might be possible that rows are getting appended but with some
> > incorrect value and are getting deleted.
> >
> > Regards
> > Akshat
>
|
|