-
Notifications
You must be signed in to change notification settings - Fork 62
PCTLoadData
Load data from .d
files.
<pct:data_load />
Attribute | Description | Default value |
---|---|---|
srcDir † | Source directory to load data from | No default value |
srcFile † | Source file to load data from | No default value |
tables | Comma separated list of tables to load. Only used with srcDir attribute | Blank means ALL |
table | Table name. Only used with srcFile attribute | No default value |
callbackClass | Callback class for the data load procedure. Only under OE 11.3+ | No default value |
errorTolerance | Acceptable error percentage (must be between 0 and 100) | 0 |
silent | Quiet log output | False |
† Only one of those attributes is mandatory ‡ Mandatory attribute
PCTLoadData inherits attributes from PCT and PCTRun.
Load a specific table. If no Table nodes are used, then PCTLoadData tries to load every table in dictionary.
Data load is executed using the Data Dictionary procedures, meaning that triggers are disabled during load.
Callback class has to implement rssw.pct.ILoadDataCallback
(link) or extend rssw.pct.AbstractLoadDataCallback
(link), and have a no-argument constructor. Those two classes are automatically injected in the PROPATH at runtime ; however, you'll have to copy the files if you want to compile your own callback.
An example class doing a full backup of the table before loading data and restoring data in case of failure is available here.
<PCTLoadData srcDir="data" dlcHome="${DLC}">
<DBConnection dbName="test" singleUser="true" />
</PCTLoadData>
Connect in single-user mode to test.db and load each file from data directory in it
<PCTLoadData srcDir="data" dlcHome="${DLC}">
<DBConnection dbName="test" singleUser="true" />
<Table name="Table1" />
<Table name="Table2" />
</PCTLoadData>
Connect in single-user mode to test.db and tries to load only Table1.d and Table2.d from data directory. If Table3 is present in dictionary, and Table3.d is present in data directory, then this file will be skipped.
<PCTLoadDataCallback srcFile="data/NewDataForTab1.d" table="Tab1" callbackProcedure="MyLogger" dlcHome="${DLC}">
<DBConnection dbName="test" singleUser="true" />
</PCTLoadDataCallback>
Connect in single-user mode to test.db, then load records from data/NewDataForTab1.d and using MyLogger class as a callback
Class MyLogger (which has to be found in propath) could be :
method public override void afterLoad(f as char, logger as rssw.pct.LoadDataLogger):
if logger:loadException or logger:bailed then copy-lob from logger:getErrors() to file "dataload.txt".
end method.
- QuickStart
- Changelog
- InstallDocumentation
- FAQ
-
Tasks
- PCT
- DlcHome
- PCTRun
- PCTDynRun
- PCTCompile
- PCTWSComp
- PCTCreateDatabase
- Sports2000
- PCTDumpSchema
- PCTDumpSequences
- PCTLoadSchema
- PCTIncrementalDump
- PCTBinaryDump
- PCTBinaryLoad
- PCTDumpData
- PCTLoadData
- PCTSchemaDoc
- PCTLibrary
- PCTProxygen
- PCTXCode
- ProgressVersion
- PCTVersion
- ClassDocumentation
- HtmlDocumentation
- XMLDocumentation
- JsonDocumentation
- ABLDuck
- OEUnit
- ABLUnit
- RestGen
- AssemblyCatalog
- Types