Filesystem Plugin.pdf - Google Drive

1 downloads 112 Views 295KB Size Report
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to op
BBj Filesystem Plugin

This presentation steps through an example of using the BBj Filesystem Plugin to access )"J3" REM Get the record template LET REC_TEMPLATE$=TMPL(1,IND=1) PRINT "RECORD TEMPLATE: " + REC_TEMPLATE$ REM Get the key template LET KEY_TEMPLATE$=TMPL(1,IND=1) PRINT "KEY TEMPLATE: " + KEY_TEMPLATE$ REM Write a record to the customer table DIM REC$:REC_TEMPLATE$ REC.CUST_NUM$="000075" REC.FIRST_NAME$="Brian" REC.LAST_NAME$="Johnson" REC.COMPANY$="BASIS" REC.BILL_ADDR1$="5901 Jefferson" REC.BILL_ADDR2$="" REC.CITY$="Albuquerque" REC.STATE$="NM" REC.COUNTRY$="US" REC.POST_CODE$="87109" REC.PHONE$="5053455232" REC.FAX$="5053455082" REC.SALESPERSON$="BOB" REC.SHIP_ZONE$="01" REC.SHIP_METHOD$="FEDEX" REC.CURRENT_BAL$="50.60" REC.OVER_30$="7" REC.OVER_60$="170" REC.OVER_90$="170" REC.OVER_120$="0" REC.SALES_MTD$="56" REC.SALES_YTD$="556" REC.SALES_LY$="340" REC.LAST_PURCH_DATE$="1999-12-19" REC.LAST_PAY_DATE$="2001-12-14" REC.CREDIT_CODE$="01" WRITE RECORD(1) REC$ REM Read a record in the customer table READ RECORD (1,KEY="000075")REC$ PRINT REC$ REM Close the customer table in the ChileCompany DB CLOSE (1)

Sample program found in the BASIS documentation. This program adds the “Brian Johnson” customer to the CUSTOMER table.

BASIS International Ltd. All rights reserved. Sales: 505.938.6120 Tech Support: 505.750.1411 E-mail: [email protected] www.basis.com

5

BBj Filesystem Plugin • REM Open the customer table in the ChileCompany DB OPEN (1,MODE="table=CUSTOMER")"J3" REM Get the record template The most significant change to the LET REC_TEMPLATE$=TMPL(1,IND=1) code is the change to the PRINT "RECORD TEMPLATE: " + application REC_TEMPLATE$ OPEN statement. Notice that the MODE REM Get the key template is used and the file name is inside the parentheses. The alias that was added to the config file is used in the place where the data file would normally go. The connection string in the config file dictates whose database the CUSTOMER table will be read from.

BASIS International Ltd. All rights reserved. Sales: 505.938.6120 Tech Support: 505.750.1411 E-mail: [email protected] www.basis.com

6