Tags:
tag this topic
create new tag
view all tags
---+ Copying Files Between Databases To copy all CUSTOMER records from one database to another: <pre> 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 </pre> 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. ---++ Comments: _Read what other users have said about this page or add your own comments._ --- <br />%COMMENT%
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2012-02-29
-
ChrisBrower
Home
Site map
Main web
MedicaidBilling web
Sandbox web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
E
dit
A
ttach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback