Updating LOBs (dbupdatelobs)
The dbupdatelobs utility allows you to update large object data (LOBs) for Landmark business objects. The utility applies to persistent fields of type Text, BinaryObject, and BinaryDocument (such as resume or image files). It thus provides a means to load the LOBs into the database more quickly than using a Landmark application to load them one by one.
To update LOBS with the dbupdatelobs
utility, you must perform three main steps:
-
Run
dbupdatelobs
with the--createinputfile
parameter in order to create a template of a CSV file for a single business class. This CSV file will contain the LOB fields with no values. You then populate this CSV file with absolute file references to LOBS in the file system. If a file reference is not provided, no database change is made for that field. If you want to delete a LOB, you can specify a reference to a zero-length file.When you run
dbupdatelobs
with the--createinputfile
parameter, you also need to specify the fields needed to locate the specific row to be updated with file references. The CSV input file must include all fields of at least one index set that does not allow duplicates. These fields will not be updated. They are only to identify the records. You can also add more non-LOBs fields to aid in identifying the records to update. Only LOB fields will be updated. -
Run
dbupdatelobs
in validation mode (-IV
) in order to check if the utility can locate both the record in which to load the LOBs and can locate the binary files based on the file references. -
Run
dbupdatelobs
in update mode (-I
) in order to load the LOBs into the database. A LOB's associated MimeType and DocumentTitle type fields will be implicitly updated if they exist just as they would if you were to import the LOB through the application. Any errors will be written to an error zip file that contains CSV files with the problem records.
Guidelines:
-
The input files must be in CSV (comma-separated-value) format.
-
The input files must have headers.
-
Input files must include the file references for the LOBs and all the fields of a unique index that does allow duplicates.
-
The file references must be in the form of an absolute path.
Syntax:
dbupdatelobs -I InputDirectory [-bqV] [-M nn] [-x transactionSize] [[--errorfile errorFile] | [--noerrorfile]]
dataArea [name ...]
dbupdatelobs -o outputDir --createinputfile field[,field...] [-f "filterString"] dataArea [name ...]
You can also use the following options for CSV formatting:
[-UW] [-D datePattern] [-E encoding] [-m delimiter] [-s separator] [-S decSep] [-T timePattern]
If you use -D datePattern
, you can also use the following option:
[-L localeName]
Program Option | Description |
---|---|
(uppercase i) |
Import the data from CSV files in the specified directory. |
--createinputfile
|
Create a CSV template file that you can then populate in order to update the LOB fields. Valid only with the -o option.
|
V
|
Validate only. This checks if the referenced files and target records exist. You can also run dbupdatelobs with this option before adding the file references to the template file created with the --createinputfile parameter. This kind of trial run will indicate if sufficient index fields have been included to identify the records where you want to update a LOBs field.
|
b
|
Brief mode; prints a summary for each file. |
q
|
Quiet mode; display only errors; do not print informational messages. |
--errorfile errorFile
|
The name of the zip file to contain CSV files
listing any records that caused errors. Use with the If you do not include either --errorfile or --noerrorfile, the utility will create error files in a zip file with the default name of dbupdatelobsErr*.zip, where * is a timestamp. |
--noerrorfile
|
Indicate that you do not want to produce an error file during the update or validate. Use with the -I or -IV options.
|
o outputDir
|
Indicate the directory where the CSV template file is to be placed. Use with the --createinputfile parameter.
|
field
|
Specify the fields from the business object to be included in the CSV template file. Separate multiple fields with commas. |
f "filterString"
|
Limit the output based on the specified filter value for the index keys of the file. The filter can be a conditional expression, such as
or
For an example of a filter in a similar command, see Example: Displaying a Field's Data Using a Filter. |
dataarea
|
The data area to update data for. |
name
|
A specific business class, module, database space, or business class pattern to execute the command against. Wildcard characters can also be used in order to specify multiple business classes. |
M nn
|
The threshold in megabytes used to determine when to write large binary objects to a temporary file on disk during the import. The default is 20MB. If the import fails or is likely to fail because of memory issues from large binary objects, lower this threshold. If your system has sufficient resources, you can consider increasing the threshold in order to speed up the import. |
x transactionsize
|
Specify the transaction size, in number of records to be held in the buffer before committing or ending transactions. This specification will override any other specification for the INSERTBUFSIZE parameter made in the db.cfg file. |
CSV File Options | |
U
|
Use UNIX line separators. |
W
|
Use Windows line separators. |
D dateformat
|
Specify the date format that dates have in the input file. You need to use this option if the dates are not already in the format yyyyMMdd. When specifying the format, use uppercase M's to indicate the month format, and lowercase d's and y's to indicate the day and year formats, respectively. For example, MM/dd/yyyy is correct but mm/dd/yyyy is not correct. For a full explanation of supported formats, see the Java API documentation for the java.text.SimpleDateFormat class. |
E encoding
|
Specify the encoding that the CSV file has.
The default is UTF-8 since dbexport creates files with UTF-8 encoding.
If you have a CSV file, with a different encoding, use this option.
Valid values are ISO-8859-1 , windows-1252 , and UTF-8 .
|
m delimiter
|
Specify the field delimiter character. |
s separator
|
Specify the field separator character. The default separator is a comma (,). |
S decimalSeparator
|
Specify the decimal separator. |
T timeformat
|
Specify the time format that times have in the input file. You need to use this option if the times are not already in the format HHmmss. When specifying the format, use uppercase H's for the hour format, and m's, and s's to indicate the minute, and second formats, respectively. For a full explanation of supported formats, see the Java API documentation for the java.text.SimpleDateFormat class. |
L localeName
|
Specify a locale in the format For example, Valid only with the |
Example
Here's an example input file for dbupatelobs
, named "Employee.csv". This example applies to standard data from the Infor HR Talent:
HROrganization,Employee,ResourcePicture.File
7004,700421,C:\Landmark\Temp\images\janedoe.png
If executed, this file will load the contents of the picture, "janedoe.png", into the ResourcePicture.File field of the Employee 700421 in HROrganization 7004. Note that the combination of the HROrganization and Employee key is sufficient to fully identify a particular row in the Employee file. This CSV file must be named Employee.csv.
The command used to execute this load would be:
dbupdatelobs -I C:\Landmark\Temp\data hcm Employee