Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble with cursors
Message
 
À
13/10/1999 20:22:15
Ray Keys-Bramlett
Custom Business Applications
Fresno, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00276127
Message ID:
00276139
Vues:
30
First, all cursors created in a SELECT-SQL statement are read only. You can change them to read/write cursors by opening them again:

SELCT * from MyTable into ReadCursor
use dbf('ReadCursor') again in 0 alias WriteCursor
You can now append records or update fields in WriteCursor without a problem.

As for whether you are going about the code in the right way, you might try combining the 2 SELECTs with a JOIN, but if your SELECTs are Rushmore optimized (indexes on family_id) it probably won't save you much time.

Keep in mind that there are usually several ways to accomplish something in VFP. If you've found a way that works and it's fast enough for your boss/client to use, it's NOT WRONG!

HTH
Barbara

>I am sure I am going about this the wrong way.
>
>Background:
> FAMILY database is shared on a a network drive
> The mailing address named (fm_????) and physical address (fp_????) are on the same record.
>
>Goal:
> I want a (local) table that contains two rows, one for each address
> (preferably not on the file server because of the multi-user)
>
>My poor attempt:
>
>select 'MAIL',fm_addr1,fm_addr2,fm_city,fm_state,fm_zip;
> from family;
> where family_id=fid;
> into cursor x1
>
>select 'SITE',fp_addr1,fp_addr2,fp_city,fp_state,fp_zip;
> from family;
> where family_id=fid;
> into cursor x2
>
>select x1
>append from x2
>
>I get an error that the cursor is read-only.
>
>Your help is appreciated.
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform