Scripting - Load
This runs the Data Loader in unattended mode.
The syntax of the LOAD script function is not given. This is a complicated function. It is suggested that you:
- use the Data Loader window to set up (and test) the load as per your requirements
- click on the File > View Load Options, or Save Load Options. AQT will generate a LOAD function that will do the load as per the options you have specified on this window. You can incorporate this function in your batch script, or run it from the Run SQL window.
Return Code in Batch Mode
When running in batch mode, the Data Loader will give a return code of 8 when it encounters a critical error. A crticial error is when one of the following happens:
- an error prevents the load control statement from running (eg. syntax error, table not found etc).
- Duplicate Row Errors is set to Stop after x Errors, and more than x duplicate errors were encountered.
- Other Errors is set to Stop after x Errors, and more than x other errors were encountered.
When running the Data Loader in online mode, these are all errors that will cause a Critical error message to be displayed (this has a large red button with a cross in it).
Running Multiple Loads
If you wish to load many multiple tables (such as all tables in a schema), this can be done as follows:
- in the Database Explorer, display all the tables in the schema you wish to load.
- click on Tools > Generate Text, and enter a line such as the following:
--aqt load,tab=$1.$2,dbs=<dbs1>,source=table,fromtab=$1.$2,fromdbs=<dbs2>
In this, replace <dbs1> and <dbs2> with the databases you are loading between.
- The above is an example of a load script that load tables in one database with tables of the same name in another database. You may need to change this load script if you wish to do a different type of load. The way to do this is to set up the load as required in the Data Loader window, then click on File > View Load Options
- Click on Generate. This will generate a script to load all the tables in the schema.
- Copy the script to your batch script or Run SQL window.