4D v14.3SQL EXPORT DATABASE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
SQL EXPORT DATABASE
SQL EXPORT DATABASE
The SQL EXPORT DATABASE command exports in SQL format all the records of all the tables in the database. In SQL, this global export operation is called "Dump". Note: This command cannot be used with an external connection that has been opened directly or via ODBC. For each table, the command generates a text file containing the SQL statements necessary for importing data into another database. This file can be used directly by the SQL EXECUTE SCRIPT command in order to import data into another 4D database. The export files will be placed in a folder named "SQLExport" that is created in the destination folder designated by the folderPath parameter. Please note that if an "SQLExport" folder already exists at the location specified, the command will replace it without any warning message being displayed. For each exported table, the command carries out the following actions:
If you pass the numFiles parameter, the command will create as many "BlobsX" subfolders as necessary so that each one of them does not contain more than numFiles BLOB, picture or external text files. By default, if the numFiles parameter is omitted, the command limits the number of files to 200. If you pass 0, each subfolder will contain at least one file. The fileLimitSize parameter lets you set a size limit (in KB) for each "Export.sql" created on disk. Once the size of the export file being created reaches the value set in fileLimitSize, 4D stops writing records, closes the file and creates a new file named "ExportX.sql" (where X represents the sequence number) next to the previous one. Note that this is a theoretical limit: the actual size of the "ExportX.sql" files exceeds the value set by fileLimitSize because the file is only closed after the record that was being exported when the limit was reached has been completely written (the contents of the records is not divided). The minimum value accepted is 100 and the maximum value (default value) is 100,000 (100 MB). The optional fieldLimitSize parameter sets a size limit below which the contents of an external BLOB, Picture or Text field will be embedded in the main "Export.sql" file rather than saved as a separate file. This purpose of this parameter is to optimize export operations by limiting the number of subfolders and files created on disk. In the export file, there may be fewer values than there are fields in the table. In this case, the empty fields will be considered as NULL. You can also pass the NULL value in a field. If the export has been carried out correctly, the OK variable is set to 1. Otherwise, it is set to 0. |
PROPERTIES
Product: 4D
HISTORY
Created: 4D v12 SEE ALSO TAGS Dump ARTICLE USAGE
4D Language Reference ( 4D v12.4) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||