Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement questions again !
Message
From
01/01/2001 21:17:49
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
01/01/2001 20:52:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00458353
Message ID:
00458355
Views:
23
Kengwen,

GO TOP is not necessary because SCAN does it automatically.
select Invoice &&table
scan
    select temptable &&cursor 
    locate for temptable.invoice_no=invoice.invoice_no 
    if found()
        replace invoice.invoice_no with temptable.invoice_no
    else
        delete <b> Which table is selected here?</b>
    endif
endscan
That being said, perhaps what you want is a parameterized view of the table, set to table buffering. Then add, update, or delete records that you see in the view, and do a TABLEUPDATE() to get all the changes back to the base table.



>hi,
> I have a table and a grid which is populating into cursor.
> I want to save/update the cursor records into the table. And since the cursor records is filter out from the table, i will add, modify or delete the records in the cursor. Now the added, modified or deleted record need to update into the table. That may have new record add in, record modify or record to be delete. How to do it in sql statement ?
>Below is my code which got problems :
>
>
select Invoice    &&table
>  go top
>  scan
>  select temptable      &&cursor
>  locate for temptable.invoice_no=invoice.invoice_no
>  if found()
>    replace invoice.invoice_no with temptable.invoice_no
>  else
>    delete
>  endif
>  endscan
>
>Code above can't locate the record, only will delete the record and didn't add in new record.
>
>thanks
>
>regards,
>kengwen
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform