Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert - sql
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01270384
Message ID:
01270465
Vues:
21
Thank you Naomi.
Please see two inserts during one pass of the scan:


SELECT vBackgroundSubjectBilling_fk

SCAN FOR UPPER(ALLTRIM(vBackgroundSubjectBilling_fk.BSB_Status)) == "REQUEST FOR BILL"

*
* insert record into the export table file
*
lcBSB_Reason = LEFT(lcBSB_Reason, 50)

INSERT INTO (ADDBS(this.icWorkingDirectory) + "BillFile.dbf") (coid, clnum, pcdate, intotbill, deid, indesc, inglnum1, ;
inglamt1, inglnum2, inglamt2, Inmeth, stid, xfer, lgname, adddte, addtime, xxo_id, xxo_prefix, xxo_ref) ;
VALUES (lnCoid, lnCLNum, vBackgroundSubjectBilling_fk.BSB_IncurDate, vBackgroundSubjectBilling_fk.BSB_Cost, SPACE(0), ;
lcBSB_Reason , 0, 0, 0, 0, "BSO", SPACE(0), .F., oUser.GetUserInfo("USR_LANID"), DATE(), TIME(), ;
vBackgroundSubject_de.BSO_ID, "BSO", SPACE(0))

this.inBillFileSum = this.inBillFileSum + vBackgroundSubjectBilling_fk.BSB_Cost
this.inBillFileRowTotal = this.inBillFileRowTotal + 1

*
* insert a credit record into the export table file
*
INSERT INTO BillFile (coid, clnum, pcdate, intotbill, deid, indesc, inglnum1, ;
inglamt1, inglnum2, inglamt2, Inmeth, stid, xfer, lgname, adddte, addtime, xxo_id, xxo_prefix, xxo_ref) ;
VALUES (lnCoid, lnCLNum, vBackgroundSubjectBilling_fk.BSB_IncurDate, -vBackgroundSubjectBilling_fk.BSB_Cost, SPACE(0), ;
lcBSB_ReasonCredit , 0, 0, 0, 0, "BSO", SPACE(0), .F., oUser.GetUserInfo("USR_LANID"), DATE(), TIME(), ;
vBackgroundSubject_de.BSO_ID, "BSO", SPACE(0))

this.inBillFileSum = this.inBillFileSum - vBackgroundSubjectBilling_fk.BSB_Cost
this.inBillFileRowTotal = this.inBillFileRowTotal + 1
*
* advance BSB_Status to billed
*
llSuccess = this.oBiz.SetBillingStatus("Billed")

ENDSCAN
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform