APPX is the Premier Development and Runtime Environment for Business Application Software
(Answer) (Category) FAQ's - APPX Software, Inc. : (Category) APPX Utility : (Category) APPX Development Environment : (Category) Tips & Techniques :
How do you copy from one application database to another within APPX.
To copy all CUSTOMER records from one database to another:

    SET       --- NEXT DATABASE   =    DB1
    OPEN      TAR CUSTOMER        SHARE? Y FAIL 0
    *
    BEG READ  TAR CUSTOMER        Hold? N
    *
    *         The DB1 Customer file is currently accessible
    *         through the CUSTOMER file name - we just read 
    *         a record from the DB1 Customer file.  Now we 
    *         Want to write this record to the DB2 Customer
    *         file - have to open it first
    *
    SET       --- NEXT DATABASE   =    DB2
    OPEN      TAR CUSTOMER        SHARE? Y FAIL 0
    WRITE     TAR CUSTOMER                 FAIL 0
    F CANCEL unexpected error (duplicate key?) WRITEing CUSTOMER 
    *
    *         Now we have to switch databases again before we
    *         do the END READ
    *
    OPEN      TAR CUSTOMER        SHARE? Y FAIL 0
    END READ  TAR CUSTOMER 
 
No CLOSE statement is needed - APPX simply switches the internal data structures between databases with each OPEN statement. This turns out to be much faster than the SPEED II method which required physically closing the file and reopening it for each database switch. Of course you have more files open with the APPX method.

When APPX needs to open a file, it does so in two phases... a logical open and a physical open. The logical open takes place when APPX opens the file automatically OR when you open the file with an OPEN statement - this phase sets up internal memory structures to keep track of the file - the structure files are also verified during the logical open (this is expensive).

The physical open only takes place when you actually do the first I/O to the file (a read, write, etc.).

A file name (use "CUSTOMER" as an example) actually acts as a file multiplexor - you can get to multiple CUSTOMER files using the same file name. You do this by setting --- NEXT DATABASE and executing an OPEN statement to open a CUSTOMER file in a different database.

[Append to This Answer]
2004-Mar-02 9:22am
Previous: (Answer) How do you call a window API function?
Next: (Answer) How to display detailed data from a scrolling input.
This document is: http://board.appx.com/cgi-bin/fom.cgi?file=425
[Search] [Appearance]
This is a Faq-O-Matic 2.719.
Copyright 2003 by APPX Software, Inc. All rights reserved.