Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid subscript reference
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01135522
Message ID:
01135539
Views:
14
>Thanx,
> i have one more doubt.. I'm trying to update a Mysql database from this array..
>
>FOR i=1 TO gncount
>lctime=ttime[i]
>SQLEXEC(lccon,"UPDATE mytab SET tdtime=?lctime WHERE tdtime='0000-00-00 00:00:00'")
>next
>
>I know this code is buggy because the tdtime field in the Mysql database is being set to one value only.. How can i update the field "tdtime" with successive values from the array??
>
>The first 50 records in Mysql are set to 0000.. and i want to update them from the array(50 values in this array)
>
>and thanx for that array fix..

I would choose different approach (just a basic code, no error handling):
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
Where PK is Field(s) which uniquely identify the records in mytab MySQL.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform