ImportCumulusFile: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
375 bytes added ,  05:49, 11 June 2020
m
Line 16: Line 16:
*a Cumulus Log already uploaded
*a Cumulus Log already uploaded


'''This script will create a table if no table exists for the selected log file'''. Be aware that as the schema varies for different script versions, ''if a table already exists it must already have the number of columns in the table to match the number of columns populated in the version of the script you choose to use''. It does not matter if the table has more column than the number of fields in the Cumulus log file, because from version 1.3(b) of the script all schemas only prohibit nulls in the columns that are present in log file for all cumulus versions. Columns for fields only present in newer Cumulus versions permit nulls, so any columns where no filed is available will be populated with a null.
'''This script will create a table if no table exists for the selected log file'''.  
 
Be aware that as the schema varies for different script versions, ''if a table already exists it '''must''' already have the number of columns in the table to '''match the number''' of columns populated in the version of the script you choose to use''.  
 
It does not matter if the table has more column than the number of fields in the Cumulus log file, because from version 1.3(b) of the script all schemas only prohibit nulls in the columns that are present in log file for all cumulus versions. Columns for fields only present in newer Cumulus versions permit nulls, so any columns where no filed is available will be populated with a null.
 
The requirements state that you must use MySQL, because the syntax used to specify the required type for each column in the CREATE syntax is specific to that database.  If all you are doing is updating an existing table, then the code will work for other database types as well because the INSERT syntax works with most databases accepting SQL instructions.


=IMPORTANT NOTE FOR VERSION 4.0+=
=IMPORTANT NOTE FOR VERSION 4.0+=
5,838

edits

Navigation menu