Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INSERT INTO cursor FROM memvar not working
Message
De
12/07/2002 11:24:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00678042
Message ID:
00678055
Vues:
13
Nick,

The problem is that your interim cursors, rp_cursor1,2 and 3 do not have the same field names as your rp_cursor. INSERT FROM memvar will only fill field names that have matching memvars. What you need to do instead is this, for each of the three interim cursors:
rp_cursor1 = SYS(2015)
SELECT op_main_key AS mainkey, 
       op_vendor   AS vendor, 
       op_amt      AS amt, 
       op_py       AS rp 
  FROM o_ord_main 
 WHERE op_py = .t. INTO CURSOR (rp_cursor1)
then your INSERT INTO (rpcursor) FROM MEMVAR will work correctly.

~~Bonnie


>I am using select command to extract information from 3 tables into cursors and then use scatter command to consolidate the information into cursor rpcursor as follows:
>
>
rpcursor = SYS(2015)
>CREATE CURSOR (rpcursor)(mainkey I, vendor c(100), amt n(10,2), rp l)
>brows
>
>
>rp_cursor1 = SYS(2015)
>SELECT op_main_key, op_vendor, op_amt, op_py FROM o_ord_main 
  WHERE op_py = .t. INTO CURSOR (rp_cursor1)
>brows
>SCATTER memvar
>INSERT INTO (rpcursor) FROM memvar
>SELECT (rpcursor)	
>brows
>
>rp_cursor2 = SYS(2015)
>SELECT p_mainkey, p_vendor, p_amt, p_py FROM sub_payment 
  WHERE p_py = .t. INTO CURSOR (rp_cursor2)
>brows
>SCATTER memvar
>INSERT INTO (rpcursor) FROM memvar
>SELECT (rpcursor)	
>brows
>
>rp_cursor3 = SYS(2015)
>SELECT r_mainkey, r_vendor, r_payamt, r_py FROM req_payment 
  WHERE r_py = .t. INTO CURSOR (rp_cursor3)
>browse
>SCATTER memvar
>INSERT INTO (rpcursor) FROM memvar
>SELECT (rpcursor)	
>brows
>
>
>My problem is when I issue
INSERT INTO (rpcursor) FROM memvar
command, it only puts zero's into the rpcursor. When I browse rp_cursor1 - rp_cursor3 I do see the information in there. What am I doing wrong here?
>
>Thanks
>Nick Patel
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform