#################################################################################################### # Digital Data Configuration File (Template Date: 30.07.2016) # # UTF-8 Coding required! # # incl. FailSafe functions that are active when information is missing. # #################################################################################################### #==================================================================================================# ########################################## General Setup ########################################### #==================================================================================================# #################################################################################################### # Path in which the log files will be stored. # # Example: E:\LogFiles\ # # FailSafe Setting is: \Logs # #################################################################################################### LogPath = E:\LogFiles\Import-FileContentToDB #################################################################################################### # Numerical value how long (in days) log files will be kept. ValidateRange is 0 - 1000 # # Setting the Value to 0 disables this Function. # # FailSafe Setting is: 60 # #################################################################################################### LogFileKeepTime = 30 #################################################################################################### # Numerical value how long (in Minutes) a File has to be there, before processing it. # # FailSafe Setting is: 5 # #################################################################################################### FileDelayAge = 1 #==================================================================================================# ######################################## Database settings ######################################## #==================================================================================================# #################################################################################################### # Set the type of database Server # # Example: MSSQL # #################################################################################################### DBType = MSSQL #################################################################################################### # Set the database connection string. # # For help, visit https://www.connectionstrings.com/ # # IMPORTANT: mask ";" with a "\" = "\;" # # Example: "Data Source=SERVERNAME\INSTANCE\;Initial Catalog=DD_ECM\;Trusted_Connection=True\; # # TrustServerCertificate=true\;" # # Example: "Data Source=SERVERNAME\INSTANCE\;Initial Catalog=DD_ECM\;User Id=SQLUSERNAME\; # # Password=SQLPASSWORD\;TrustServerCertificate=true\;" # #################################################################################################### DBConnString = "Data Source=S-ZLSDMS-DB1\;Initial Catalog=DD_ECM\;User Id=DD_ECM\;Password=dd_ecm\;TrustServerCertificate=true\;" #==================================================================================================# ########################################## Profile Setup ########################################### #==================================================================================================# #################################################################################################### # In the following section(s), it is possible to use multiple variables in File and Folder Paths, # # in SQL Statements as well and other data related specifications. # # # # = # # %USERNAME% = The current User Name running this Script # # %USERDOMAIN% = The current Domain Name, User is logged on # # %COMPUTERNAME% = The Computername on which this Script is running # # %LOGONSERVER% = The currently connected Domain Controller # # %SCAN%& = Scan Tag for Batch scanning, will be replaced with - nothing # # %DATE% = Get Date in this Format: dd.MM.yyyy # # %TIMESTAMP1% = Get Date in this Format: ddMMyyyy # # %TIMESTAMP2% = Get Date and Time in this Format: ddMMyyyy_HHmmss # # %TIMESTAMP3% = Get Date and Time in this Format: ddMMyyyy_HHmmssffff # # %TIMESTAMP4% = Get Date and Time in this Format: yyyyMMdd HHmmssfff # # %TIMESTAMP5% = Get Date and Time in this Format: yyyyMMdd_HHmmss # # %TIMESTAMP6% = Get Date in this Format: dd.MM.yyyy # # %TIMESTAMP7% = Get Date and Time in this Format: dd.MM.yyyy_HH:mm:ss # # %TIMESTAMP8% = Get Date and Time in this Format: dd.MM.yyyy_HH:mm:ss.ffff # # %TIMESTAMP9% = Get Date and Time in this Format: yyyy/MM/dd HH:mm:ss.fff # # %TIMESTAMP10% = Get Date and Time in this Format: yyyy/MM/dd HH:mm:ss # #--------------------------------------------------------------------------------------------------# # Additional Variables specific for this Script are: # # %SourceFile% = Name of the processed File, including its Extension # # %SourceFilePath% = Directory of the processed File # # %SourceFileFullName% = Directory and Name of the processed File, including its Extension # # # # This dump table is matching with Function: "Update-ReplacePlaceholder-withLogging" # # Version Number: 1.0.0.0 / Version Date: 25.10.2018 # #################################################################################################### #################################################################################################### # Define Profiles in this config file for the executing Script. # # Syntax: # # Profile = ; ; ; ; ;# # ; ; ; ; # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Set the way, Script is reading the SourceFile. # # Currently only the BulkImport is available. # # Example: ExcelImport # # Example: CSVImport # #--------------------------------------------------------------------------------------------------# # Second Parameter: # # For future use.... # # Example: %CellValue% # #--------------------------------------------------------------------------------------------------# # Third Parameter: # # Set the path to the source files. # # Example: E:\SourceFiles\*.csv # # Example: E:\SourceFiles\SourceFile.xlsx # #--------------------------------------------------------------------------------------------------# # Fourth Parameter: # # Set the encoding type, the source files are written with. # # Example: ascii # # Example: utf7 # # Example: utf8 # # Example: unicode # #--------------------------------------------------------------------------------------------------# # Fifth Parameter: # # Set the line of the heading of the table. # # Its the template for the inserts, only selected header columns will be imported. # # Example: 1 # #--------------------------------------------------------------------------------------------------# # Sixth Parameter: # # Set the first line with data to import. # # Example: 2 # #--------------------------------------------------------------------------------------------------# # Seventh Parameter: # # Set the last line with data to import. # # You can set a very high number to guarantee everything will be imported. # # Example: 9999999 # #--------------------------------------------------------------------------------------------------# # Eight Parameter: # # Set the CSV value seperator or the XLSX tab name. # # Example: \; # # Example: XAP__Stammdaten_Adressen # #--------------------------------------------------------------------------------------------------# # Ninth Parameter: # # Set the path, where successful processed files should be moved to. # # Example: E:\Archiv # #--------------------------------------------------------------------------------------------------# # Tenth Parameter: # # Set the path, where unsuccessful processed files should be moved to. # # Example: E:\Error # #--------------------------------------------------------------------------------------------------# # Argument call: # # If you need to run the Script with dynamic Values, you can do so, by calling it with arguments. # # Even the Special and Optional Parameters are available in this case. # # Example: # # This Function is currently not implement! # #################################################################################################### #################################################################################################### # Define additional special Profiles . # # Syntax: # # PreparingFile = # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Set a replace command if necessary. # # Example: Replace(~,~) # #################################################################################################### #################################################################################################### # Define additional special Profiles . # # Syntax: # # CheckSQL = # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Set the first SQL Query, this query will only be run once per file. # # Example: DELETE FROM [DD_ECM].[dbo].[TABLE] # #################################################################################################### #################################################################################################### # Define additional special Profiles . # # Syntax: # # InitialSQL = # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Set the second SQL Query, this query will only be run once per file. # # Example: DELETE FROM [DD_ECM].[dbo].[TABLE] # #################################################################################################### #################################################################################################### # Define additional special Profiles . # # Syntax: # # PreparingSQL = # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Set the third SQL Query, this query will only be run once per file. # # Example: DELETE FROM [DD_ECM].[dbo].[TABLE] # #################################################################################################### #################################################################################################### # Define additional special Profiles . # # Syntax: # # MainLoopSQL = # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Set the fourth SQL Query, this query will be run for every selected line in source file. # # Use placeholder like '%column1%', for the cell values from the source file. # # Example: INSERT INTO [DD_ECM].[dbo].[TABLE](column1,column2) SELECT '%column1%','%column2%' # #################################################################################################### #################################################################################################### # Define additional special Profiles . # # Syntax: # # FinalSQL = # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Set the fifth SQL Query, this query will only be run once per file. # # Example: DELETE FROM [DD_ECM].[dbo].[TABLE] # #################################################################################################### Profile = ExcelImport ; %CellValue% ; E:\FileProcessing\Input\File\DocumentKindAssigned\XAP_Adressstammdaten\*.xlsx ; utf7 ; 4 ; 5 ; 999999999 ; XAP__Stammdaten_Adressen(2) ; E:\FileProcessing\Output\File\DocumentKindAssigned\XAP_Adressstammdaten ; E:\FileProcessing\Output\File\DocumentKindAssigned\XAP_Adressstammdaten PreparingFile = CheckSQL = InitialSQL = DELETE FROM [DD_ECM].[dbo].[TBCUST_XAP_KUNDENSTAMM] PreparingSQL = MainLoopSQL = INSERT INTO [DD_ECM].[dbo].[TBCUST_XAP_KUNDENSTAMM]([Kundennummer],[Objektnummer],[Versorgungsart],[rAdressart],[rAnrede],[rNAME1],[rNAME2],[rStraße],[rHausnummer],[rPostfach],[rPLZ],[rOrt],[rTelefon],[rMail],[vAdressart],[vAnrede],[vNAME1],[vNAME2],[vStraße],[vHausnummer],[vPostfach],[vPLZ],[vOrt],[vTelefon],[vMail],[ADDED_WHO],[ADDED_WHEN]) SELECT '%column1%','%column2%','%column3%','%column4%','%column5%','%column6%','%column7%','%column8%','%column9%','%column10%','%column11%','%column12%','%column13%','%column14%','%column15%','%column16%','%column17%','%column18%','%column19%','%column20%','%column21%','%column22%','%column23%','%column24%','%column25%','Import-FileContentToDB',getdate() FinalSQL = Profile = CSVImport ; %CellValue% ; \\s-zls22\Somentec\XAP-Mandanten\XAPPROD\Archiv\*.csv ; utf7 ; 3 ; 4 ; 999999999 ; \^\,\^|\^ ; \\s-zls22\Somentec\XAP-Mandanten\XAPPROD\Archiv\DMS-Eingelesen ; \\s-zls22\Somentec\XAP-Mandanten\XAPPROD\Archiv\DMS-Fehler PreparingFile = Replace(@FOLDER,FT:^HKA-IMP^~,~HKA-IMP) CheckSQL = InitialSQL = PreparingSQL = MainLoopSQL = INSERT INTO [DD_ECM].[dbo].[TBCUST_XAP_DOC_EXPORT]([XAP_Beleg_ID],[XAP_Kunden_ID],[XAP_Kundenname],[XAP_Objekt_ID],[XAP_Objektbezeichnung],[XAP_Belegdatum],[XAP_Formular_ID],[XAP_Exportpfad],[ADDED_WHO],[ADDED_WHEN]) SELECT '%column1%','%column2%','%column3%','%column4%','%column5%','%column6%','%column7%','%column8%','Import-FileContentToDB',getdate() FinalSQL = #Example: #Profile = ExcelImport ; %CellValue% ; E:\FileProcessing\Input\File\DocumentKindAssigned\XAP_Adressstammdaten\*.xlsx ; utf7 ; 4 ; 5 ; 999999999 ; XAP__Stammdaten_Adressen(2) ; E:\FileProcessing\Output\File\DocumentKindAssigned\XAP_Adressstammdaten ; E:\FileProcessing\Output\File\DocumentKindAssigned\XAP_Adressstammdaten #PreparingFile = #CheckSQL = #InitialSQL = DELETE FROM [DD_ECM].[dbo].[TBCUST_XAP_KUNDENSTAMM] #PreparingSQL = #MainLoopSQL = INSERT INTO [DD_ECM].[dbo].[TBCUST_XAP_KUNDENSTAMM]([Kundennummer],[Objektnummer],[Versorgungsart],[rAdressart],[rAnrede],[rNAME1],[rNAME2],[rStraße],[rHausnummer],[rPostfach],[rPLZ],[rOrt],[rTelefon],[rMail],[vAdressart],[vAnrede],[vNAME1],[vNAME2],[vStraße],[vHausnummer],[vPostfach],[vPLZ],[vOrt],[vTelefon],[vMail],[ADDED_WHO],[ADDED_WHEN]) SELECT '%column1%','%column2%','%column3%','%column4%','%column5%','%column6%','%column7%','%column8%','%column9%','%column10%','%column11%','%column12%','%column13%','%column14%','%column15%','%column16%','%column17%','%column18%','%column19%','%column20%','%column21%','%column22%','%column23%','%column24%','%column25%','Import-FileContentToDB',getdate() #FinalSQL = #Profile = CSVImport ; %CellValue% ; \\s-zls22\Somentec\XAP-Mandanten\XAPPROD\Archiv\*.csv ; utf7 ; 3 ; 4 ; 999999999 ; \^\,\^|\^ ; \\s-zls22\Somentec\XAP-Mandanten\XAPPROD\Archiv\DMS-Eingelesen ; \\s-zls22\Somentec\XAP-Mandanten\XAPPROD\Archiv\DMS-Fehler #PreparingFile = Replace(@FOLDER,FT:^HKA-IMP^~,~HKA-IMP) #CheckSQL = #InitialSQL = #PreparingSQL = #MainLoopSQL = INSERT INTO [DD_ECM].[dbo].[TBCUST_XAP_DOC_EXPORT]([XAP_Beleg_ID],[XAP_Kunden_ID],[XAP_Kundenname],[XAP_Objekt_ID],[XAP_Objektbezeichnung],[XAP_Belegdatum],[XAP_Formular_ID],[XAP_Exportpfad],[ADDED_WHO],[ADDED_WHEN]) SELECT '%column1%','%column2%','%column3%','%column4%','%column5%','%column6%','%column7%','%column8%','Import-FileContentToDB',getdate() #FinalSQL =