Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert - sql
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01270384
Message ID:
01270465
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform