>Hey buddy ,
> Im curious abt cursors.. Is there a way to reset(or flush) the cursors so that it can be used for a new update. I have different folders, all with "tlog.dbf" tables. I'm trying to import data frm all these tables into one Mysql "tlog" table(basically updating). I ran ur piece of code and it worked fine.But when I tried to update the Mysql tlog table using a different "tlog.dbf" table, it just wrote the same data that was placed previously into cursor crsTest..
>
>
>SELECT PK, tempt FROM tlog;
> into CURSOR crsTest && With all WHERE, GROUP BY if needed
>SQLPREPARE(lccon, [UPDATE mytab SET tdtime=?crsTest.TempT WHERE mytab.PK = ?crsTest.PK])
>SELECT crsTest
>SCAN
> SQLEXEC(lccon)
>ENDSCAN
But they maybe contains the same data?
If not:
Suppose you have cursor with all folders, or array or something else (I prefer cursor).
Lets that cursor has one memo field named mFolder in with you have full path to the folder and file name i.e.
SQLPREPARE(lccon, [UPDATE mytab SET tdtime=?crsTest.TempT WHERE mytab.PK = ?crsTest.PK])
SELECT MyFolderCursor
SCAN
lcFileName = ALLTRIM(mFolder)
SELECT PK, tempt FROM (lcFileName);
into CURSOR crsTest
SELECT crsTest
SCAN
SQLEXEC(lccon)
ENDSCAN
SELECT MyFolderCursor
ENDSCAN
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.