252 lines
24 KiB
INI
252 lines
24 KiB
INI
####################################################################################################
|
|
# 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\<ScriptName> #
|
|
# FailSafe Setting is: <ScriptPath>\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. #
|
|
# #
|
|
# <VariableName> = <ReplaceWithThisValue> #
|
|
# %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 = <ImportMethode> ; <ImportFormat> ; <SourcePath> ; <SourceFileEncoding> ; <HeaderLine> ;#
|
|
# <FirstLine> ; <LastLine> ; <CSV-ValueSeperator|XSLX-Tab-name> ; <ArchivPath> ; <ErrorPath> #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# First Parameter: <ImportMethode> #
|
|
# Set the way, Script is reading the SourceFile. #
|
|
# Currently only the BulkImport is available. #
|
|
# Example: ExcelImport #
|
|
# Example: CSVImport #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Second Parameter: <ImportFormat> #
|
|
# For future use.... #
|
|
# Option is unavailable in Bulk Insert! #
|
|
# Example: %CellValue% #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Third Parameter: <SourcePath> #
|
|
# Set the path to the source files. #
|
|
# Example: E:\SourceFiles\*.csv #
|
|
# Example: E:\SourceFiles\SourceFile.xlsx #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Fourth Parameter: <SourceFileEncoding> #
|
|
# Set the encoding type, the source files are written with. #
|
|
# Example: Default #
|
|
# Example: ascii #
|
|
# Example: ansi #
|
|
# Example: bigendianunicode #
|
|
# Example: bigendianutf32 #
|
|
# Example: oem #
|
|
# Example: unicode #
|
|
# Example: utf7 #
|
|
# Example: utf8 #
|
|
# Example: utf8BOM #
|
|
# Example: utf8NoBOM #
|
|
# Example: utf32 #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Fifth Parameter: <HeaderLine> #
|
|
# 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: <FirstLine> #
|
|
# Set the first line with data to import. #
|
|
# Example: 2 #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Seventh Parameter: <LastLine> #
|
|
# 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: <CSV-ValueSeperator|XSLX-Tab-name> #
|
|
# Set the CSV value seperator or the XLSX tab name (or a part of it). #
|
|
# Example: \; (.net RegEx is available) #
|
|
# Example: `n (Line Break in case of bulk Insert) #
|
|
# Example: XAP #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Ninth Parameter: <ArchivPath> #
|
|
# Set the path, where successful processed files should be moved to. #
|
|
# Example: E:\Archiv #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Tenth Parameter: <ErrorPath> #
|
|
# 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: #
|
|
# Import-FileContentToDB.ps1 -argProfileID 1 #
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
# Define additional special Profiles . #
|
|
# Syntax: #
|
|
# PreparingFile = <Command> #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# First Parameter: <Command> #
|
|
# Set a replace command if necessary. You can set multiple Commands, by seperation them with ~|~ #
|
|
# Example: Replace(<OldString>~,~<NewString>) #
|
|
# Example: Replace(<OldString1>~,~<NewString1>) ~|~ Replace(<OldString2>~,~<NewString2>) #
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
# Define additional special Profiles . #
|
|
# Syntax: #
|
|
# CheckSQL = <SQLQuery> #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# First Parameter: <Command> #
|
|
# Set the first SQL Query. #
|
|
# Example: DELETE FROM [DD_ECM].[dbo].[TABLE] #
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
# Define additional special Profiles . #
|
|
# Syntax: #
|
|
# InitialSQL = <SQLQuery> #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# First Parameter: <Command> #
|
|
# Set the second SQL Query. #
|
|
# Example: DELETE FROM [DD_ECM].[dbo].[TABLE] #
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
# Define additional special Profiles . #
|
|
# Syntax: #
|
|
# PreparingSQL = <SQLQuery> #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# First Parameter: <Command> #
|
|
# Set the third SQL Query. #
|
|
# Example: DELETE FROM [DD_ECM].[dbo].[TABLE] #
|
|
####################################################################################################
|
|
|
|
####################################################################################################
|
|
# Define additional special Profiles . #
|
|
# Syntax: #
|
|
# MainLoopSQL = <SQLQuery> #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# First Parameter: <Command> #
|
|
# 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 = <SQLQuery> #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# First Parameter: <Command> #
|
|
# 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 ; E:\FileProcessing\Archive\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-zls32\XAP\XAP-Daten\ZLS\ZLS_WASS\XAP_ZLS_WASS_P\ARC\*.csv ; utf7 ; 3 ; 4 ; 999999999 ; \^\,\^|\^ ; \\s-zls32\XAP\XAP-Daten\ZLS\ZLS_WASS\XAP_ZLS_WASS_P\ARC\DMS-Eingelesen ; \\s-zls32\XAP\XAP-Daten\ZLS\ZLS_WASS\XAP_ZLS_WASS_P\ARC\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-zls32\XAP\XAP-Daten\ZLS\ZLS_WASS\XAP_ZLS_WASS_P\ARC\*.csv ; utf7 ; 3 ; 4 ; 999999999 ; \^\,\^|\^ ; \\s-zls32\XAP\XAP-Daten\ZLS\ZLS_WASS\XAP_ZLS_WASS_P\ARC\DMS-Eingelesen ; \\s-zls32\XAP\XAP-Daten\ZLS\ZLS_WASS\XAP_ZLS_WASS_P\ARC\DMS-Fehler
|
|
#PreparingFile = Replace(WertA~,~WertB) ~|~ 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 = |