Subject |
Re: xdml append from problem |
From |
Akshat Kapoor <akshat.kapoor@kapoorsons.in> |
Date |
Thu, 29 Aug 2024 11:11:19 +0530 |
Newsgroups |
dbase.getting-started |
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
|
|