Exporting Data (dbexport)
dbexport creates a binary or CSV file containing data from a Landmark-defined database file. You can load this data into the Lawson system using dbimport.
Do not use this utility to export data from a non-Landmark defined database file.
Do not use this utility to copy GEN (Environment) data from one machine to another.
- At a Landmark command prompt, type
dbexport -o outputDir [OPTIONS] dataArea [name ...]- or -
dbexport -z zipfile [OPTIONS] dataArea [name ...]dbexport --showrules zipfile [OPTIONS] dataArea [name ...]If you use
-C, you can also use the following options:[-n] [-D datePattern] [-m delimiterCharacter] [-s separatorCharacter] [-S decimalSeparator] [-T timePattern] [--userfields] [--translations] [--workfile] [--workfilename]If you use
-D datePattern, you can also use the following options:[-L localeName] - Consider the following
Program Option Description -o outputDirectoryExport the database to a specified output directory
Note:It is also possible to export to stdout and then import from stdin using a single hyphen to represent the file. For example, the following would do a dbexport out of dataArea1 and pipe the output into a dbimport to dataArea2. The data is never written to disk in this case.
dbexport –Co – dataArea1 businessClass | dbimport –CI – dataArea2 businessClass-z filename.zipSpecify the name of a compressed ( .zip) file to export data to.-A fieldAssignmentFileor--faf=fieldAssignmentFileUse information in a specified file to change field or file names, or initialize field values in the destination file. FieldAssignmentFile is the Field assignment file name.
-BUse the business class parser when filtering. The default is to parse against the dictionary rather than the business class spec repository. However, if you are filtering on such things as derived fields, the business class parser may be necessary. -bor--briefBrief mode (print only summary for each file). -Cor--csvCreate the output in a comma-separated value format.
If you do not use this option, a binary output file will be created. Each record's byte array will be written directly to the file, without a header record.
-d targetDictionarySpecify the target dictionary to export. -f "filterString"or--filter=filterStringLimit the output based on the specified filter value for the index keys of the file. The filter can be a conditional expression, such as
-f "fileName.fieldName=1"or
-f "relationshipName.fieldName=1"--firstrow=NStart the export from the specified row. -i indexNameor--index=indexNameUse index (for example, -iGLMSET1). Exports the data using an index sequence. The index name must follow the -i. --ignorefaferrorsIgnore most errors in the field assignment file. -l(lowercase L) or--nolobsDo not export large objects. --maxrows=NExport at most the specified maximum number of rows. -qor--quietQuiet mode (print only errors, do not print informational messages) --showrulesPrint the field assignment file rules that will be used. --showtimingsShow timings for each file. --threads=nRun dbexportwith the specified number of threads. If you use multiple threads, you may see a performance improvement. However, performance depends on other factors as well. Note that a very large table will be processed in a single thread.--useupgradenamesUse the upgrade names for tables. Only use if directed to by support personnel. -vor--includeviewsInclude files that are in isView spaces. -Verrorlevel or--errorlevel=errorlevelerrorlevel,tracelevel, andverbosespecified in any order, where:-
errorlevel= {n}none | {f}atal | {e}rror | {w}arning (warning is the default) -
tracelevel= 0:6 where 0 is no message and 6 is everything -
verbose= whether to display exception stacktrace
dataareaSpecify the data area for the file(s) that you want to export. name...A specific business class, module, database space, or business class pattern to execute the command against.
Use the prefixes
file-,pattern-,space-, ormodule-to resolve ambiguity. File names can be the long or classic name and can include?and*. Specifying"!"anywhere in the list will complement the selected files. Specifying@pathreads names from the file, one per line. A hyphen (-) indicates stdin. A:Lon a file name selects the lobs table. A:Bon a file name selects the base table.Options valid with -C --classicnamesUse classic names for files and columns. -D datePatternSpecify the date format that you want dates to have in the output file. Do not use this option if you are exporting data from Lawson and plan to import it back into Lawson. Only use this option if you plan to export the Lawson dates into a different format for import into a non-Lawson system. If you do not use this option, the dates will be in the default 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.
--dumpemptyDump files even when they contain no data (valid only with field headers). -F field,field,...or--fields=field,field,...Export only the specified fields. This option is valid only with field headers and when you are exporting a single file. -m delimiterCharacterSet the field delimiter character.
The default delimiter is a double quote (").
-nor --noheadersDo not create field headers. -Oor--isoISO data and time patterns. This overrides the -Dand-Toptions.-s separatorCharacterSet the field separator character.
The default separator is a comma (,).
-S decimalSeparatorSpecify the decimal separator. -T timePatternSpecify the time format that you want times to have in the output file. Do not use this option if you are exporting data from Lawson and plan to import it back into Lawson. Only use this option if you plan to export the Lawson times into a different format for import into a non-Lawson system. If you do not use this option, the times will be in the default 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.
Valid only with the
-Coption.--userfieldsInclude user-defined fields in the export to CSV. This applies in two scenarios:
-
One, you want to export the user-defined field data from a delivered business class to which you have added user-defined fields.
-
Two, you want to export the data from a user-defined business class.
--translationsInclude translations in a CSV file. If you use this option, the translations will be included in the main export file in a column named in the format:
fieldName{locale}, for examplename{es_ES}.If you do not use this option and are exporting specific named files or tables that contains data translations, the data translations will not be included in the export. However, if you do not use this option but export all of the files for a data area, module, or pattern match for files that have data translations, additional files will be created for those translations. The name format of these additional files is fileName_Translation.csv.
--workfileExport workfiles. --workfilenameThe name of a workfile to export. The default is the input filename. Options valid with -D -L localeNameSpecify a locale in the format
language[_COUNTRY[_variant]].For example,
en_USValid only with the
-Doption. -