Hello:
I have some code where I am importing transactions. I have a cursor for these transactions where I validate them. After doing this, I want to add them to the transaction table. I select the transaction alias and then do append from (alimport)
alimport is an alias variable. It works for creating the cursor: SQLSEL * from cwkt; where .f.; into cursor (alimport) readwrite nofilter It works to select the cursor: select (alimport)
So why does the append not work? I get error 1 with the text "File 'c:\cbs2dev\cutlblas_import.dbf' does not exist."
I figured out how to do this using SQL, but I would still like to know why the append does not work.
Sincerely,
Gene Wirchenko
append from (dbf(alimport))
Append from expects a file
Thierry Nivelet http://foxincloud.com/ Give your VFP app a second life in the cloud
Le 11 avr. 2018 à 20:03, Gene Wirchenko genew@telus.net a écrit :
append from (alimport)
You could try
APPEND FROM DBF(alimport)
John
John Weller 01380 723235 07976 393631
Hello:
I have some code where I am importing transactions. I have acursor for these transactions where I validate them. After doing this, I want to add them to the transaction table. I select the transaction alias and then do append from (alimport)
alimport is an alias variable. It works for creating the cursor: SQLSEL * from cwkt; where .f.; into cursor (alimport) readwrite nofilterIt works to select the cursor: select (alimport)
So why does the append not work? I get error 1 with the text"File 'c:\cbs2dev\cutlblas_import.dbf' does not exist."
I figured out how to do this using SQL, but I would still liketo know why the append does not work.
Hi Gene,
'append from' appends data from a file on the disk and a cursor is not a file !
Can you try this : APPEND FROM (DBF(m.alimport))
The Foxil
On Thu, 12 Apr 2018, at 1:31 PM, Jean MAURICE wrote:
Hi Gene,
'append from' appends data from a file on the disk and a cursor is not a file !
A cursor may or may not have a disk presence depending on various factors.
But SQL is a a better way to do it.
insert into mytable (f1, f2, f3) select (f1, f2, f3) from mycursor
Append from dbf('yourcursor')
Rafael Copquin
El mié., 11 de abr. de 2018 15:02, Gene Wirchenko genew@telus.net escribió:
Hello:
I have some code where I am importing transactions. I have acursor for these transactions where I validate them. After doing this, I want to add them to the transaction table. I select the transaction alias and then do append from (alimport)
alimport is an alias variable. It works for creating the cursor: SQLSEL * from cwkt; where .f.; into cursor (alimport) readwrite nofilterIt works to select the cursor: select (alimport)
So why does the append not work? I get error 1 with the text"File 'c:\cbs2dev\cutlblas_import.dbf' does not exist."
I figured out how to do this using SQL, but I would still liketo know why the append does not work.
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]