Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems using array created from SELECT
Message
De
15/06/2004 01:42:53
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Problems using array created from SELECT
Divers
Thread ID:
00913760
Message ID:
00913760
Vues:
50
I am trying to create an array from a select and then use the values in the array in an insert statement. I read somewhere that if you create an array with a select and there is no data, the array isn;t created. Becuase of this, I added a check to _tally and created the arrays manually. Before I made the change I was getting voidarray does not exist. After my change I am getting operator/operand type mismatch. Any ideas?

SELECT tpi
SCAN
IF tpi.creditmemo = .T.
SELECT totaldue FROM vi INTO ARRAY voidtotal WHERE invno = tpi.ordnum
IF _TALLY = 0
DIMENSION voidtotal[1]
voidtotal[1] = SPACE(1)
ENDIF
SELECT totalpaid FROM vi INTO ARRAY vitotalpaid WHERE invno = tpi.ordnum
IF _TALLY = 0
DIMENSION vitotalpaid[1]
vitotalpaid[1] = SPACE(1)
ENDIF
INSERT INTO payinv (invno,custno,company,invdate,changed,totaldue,totalpaid,creditInv);
VALUES (tpi.ordnum,tpi.custno,tpi.company,tpi.invdate,tpi.changed,tpi.totaldue+voidtotal-;
vitotalpaid,;
0.00,tpi.invno)
SELECT invpost
UPDATE invpost SET totaldue = tpi.totaldue+voidtotal-vitotalpaid ;
WHERE invno = tpi.ordnum
UPDATE invpost SET totaldue = tpi.totaldue+voidtotal-vitotalpaid ;
WHERE invno = tpi.invno
TABLEUPDATE()
SELECT tpi
ELSE
INSERT INTO payinv (invno,custno,company,invdate,changed,totaldue,totalpaid) ;
VALUES (tpi.invno,tpi.custno,tpi.company,tpi.invdate,tpi.changed,tpi.totaldue,;
tpi.totalpaid)
ENDIF
ENDSCAN
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform