8
0

Arbeiten am Import-FileContentToDB Skript noch laufen

This commit is contained in:
2024-02-21 13:27:52 +01:00
parent 890d87cf6d
commit eb1baf4357
33 changed files with 224 additions and 2520923 deletions

View File

@@ -32,39 +32,23 @@ FileDelayAge = 1
######################################## Database settings ########################################
#==================================================================================================#
####################################################################################################
# Name or IP-Adress of the Database Server. #
# Example: 192.168.0.1 #
# Example: 192.168.0.1\<SQLInstance> #
####################################################################################################
DBSQLConnectServer = 172.24.12.41\tests
# Set the type of database Server #
# Example: MSSQL #
####################################################################################################
DBType = MSSQL
####################################################################################################
# UserName for the SQL Connection. #
# This Setting is not neccessary if DBSQLConnectIntegratedSecurity is set to "true". #
# Example: sa #
####################################################################################################
DBSQLConnectUserName = sa
####################################################################################################
# Password for the specified UserName you set before. #
# This Setting is not neccessary if DBSQLConnectIntegratedSecurity is set to "true". #
# 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\;" #
####################################################################################################
DBSQLConnectUserPassword = dd
####################################################################################################
# Set the Database Name which exists on the Database Server. #
# Example: windream60 #
####################################################################################################
DBSQLConnectDatabase = DD_ECM_WISAG
####################################################################################################
# Set this to "True" if the Windows Login credentials should be used of Database Login. #
# In this case DBSQLConnectUserName and DBSQLConnectUserPassword setting will be ignored! #
# Example: True #
# Example: False #
####################################################################################################
DBSQLConnectIntegratedSecurity = false
#DBConnString = "Data Source=S-ZLSDMS-DB1\;Initial Catalog=DD_ECM\;Trusted_Connection=True\;TrustServerCertificate=true\;"
DBConnString = "Data Source=SDD-VMP04-SQL17\DD_DEVELOP01\;Initial Catalog=DD_ECM\;Trusted_Connection=True\;TrustServerCertificate=true\;"
#==================================================================================================#
########################################## Profile Setup ###########################################
@@ -107,12 +91,12 @@ DBSQLConnectIntegratedSecurity = false
# Profile = <ImportMethode> ; <ImportFormat> ; <SourcePath> ; <FirstLine> ; <LastLine> ; #
# <ValueSeperator> ; <ArchivPath> ; <ErrorPath> #
# Example: #
# Profile = BulkImport ; e:\SourceFile.csv #
# Profile_CheckSQLQuery = SQL Statements (SELECT)
# Profile_InitialSQLQuery = SQL Statements (SELECT, INSERT, UPDATE)
# Profile_PreparingSQLQuery = SQL Statements (SELECT, INSERT, UPDATE)
# Profile_MainLoopSQLQuery = SQL Statements (INSERT, UPDATE)
# Profile_FinalSQLQuery = SQL Statements (SELECT, INSERT, UPDATE)
# Profile = BulkImport ; e:\SourceFile.csv #
# Profile = CheckSQLQuery ; SQL Statement (SELECT) #
# Profile = InitialSQLQuery ; SQL Statement (SELECT, INSERT, UPDATE) #
# Profile = PreparingSQLQuery ; SQL Statement (SELECT, INSERT, UPDATE) #
# Profile = MainLoopSQLQuery ; SQL Statement (INSERT, UPDATE) #
# Profile = FinalSQLQuery ; SQL Statement (SELECT, INSERT, UPDATE) #
#--------------------------------------------------------------------------------------------------#
# First Parameter: <ImportMethode> #
# Set the way, Script is reading the SourceFile. #
@@ -140,25 +124,21 @@ DBSQLConnectIntegratedSecurity = false
# Example: #
# This Function is currently not implement! #
####################################################################################################
#%ColumnName%|
Profile = BulkImport ; %CellValue% ; P:\Skriptentwickung\development\Import-FileContent2Database\wisag_test-dateien\AVIAFAK_LFB1.DAT ; 1 ; max ; .
#;%SourceFilePath%\Archiv\%Timestamp5% ; %SourceFilePath%\Error
Profile_CheckSQLQuery = SELECT 'true'
Profile_InitialSQLQuery =
Profile_PreparingSQLQuery =
Profile_MainLoopSQLQuery = INSERT INTO [DD_ECM_WISAG].[dbo].[SAP_IMPORT] (c001, c002, c003, c004, c005, c006) Select '%column1%', '%column2%', '%column3%', '%column4%', '%column5%', '%column6%'
Profile_FinalSQLQuery =
Profile = CSVImport ; %CellValue% ; D:\ScriptFiles\Import-FileContentToDB\*.csv ; 4 ; 999999999 ; \^\,\^|\^ ; E:\archiv ; E:\error
#Profile = ExcelImport ; %CellValue% ; D:\ScriptFiles\Import-FileContentToDB\Stammdaten.xlsx ; 4 ; 999999999 ; \^\,\^|\^ ; E:\archiv ; E:\error
CheckSQL = SELECT 'true'
InitialSQL =
PreparingSQL = DELETE FROM [DD_ECM].[dbo].[TBCUST_XAP_KUNDENSTAMM_TEST]
MainLoopSQL = INSERT INTO [DD_ECM_ZLS].[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%','DD',getdate()
FinalSQL =
#Example:
#Profile = BulkImport ; %ColumnName%|%CellValue% ; P:\Skriptentwickung\development\Import-CSV2DB\test-dateien\AltesFormat\*.txt ; 1 ; 2 ; . ;%SourceFilePath%\Archiv\%Timestamp5% ; %SourceFilePath%\Error
#Profile_CheckSQLQuery = SELECT 'true'
#Profile_InitialSQLQuery = SELECT (SELECT [u003] FROM [CWLDATEN].[dbo].[t693] WHERE [u000] = 1)+1
#Profile_PreparingSQLQuery = INSERT INTO [CWLDATEN].[dbo].[TBDD_BATCHIMPORT_HEAD] (BELEGKEY, Konto, Laufnummer, Auftragsnummer) VALUES (%InitialSQLResult%, '700131', NULL, NULL) UPDATE [CWLDATEN].[dbo].[t693] SET u003 = %InitialSQLResult% WHERE [u000] = 1
#Profile_MainLoopSQLQuery = INSERT INTO [CWLDATEN].[dbo].[t699] (u000, u001, u002, u003, u004, u005, u006, u007, u008, u009, u010, u011, u012, u013, u014, u015, u016, u029, u030) Select ISNULL(MAX(u000),0) + 1, %InitialSQLResult%, '%sourcefile%', '%column3%', '%column1%', '%column2%', '%column3%', '%column4%', '%column5%', '%column6%', '%column7%', '%column8%', '%column9%', '%column10%', '%column11%', '%column12%', '%column13%', getdate(), '%username%' FROM [CWLDATEN].[dbo].[t699]
#Profile_FinalSQLQuery =
#Profile = CSVImport ; %ColumnName%|%CellValue% ; P:\Skriptentwickung\development\Import-CSV2DB\test-dateien\AltesFormat\*.txt ; 1 ; 2 ; . ;%SourceFilePath%\Archiv\%Timestamp5% ; %SourceFilePath%\Error
#Profile = CheckSQLQuery = SELECT 'true'
#Profile = InitialSQLQuery = SELECT (SELECT [u003] FROM [CWLDATEN].[dbo].[t693] WHERE [u000] = 1)+1
#Profile = PreparingSQLQuery = INSERT INTO [CWLDATEN].[dbo].[TBDD_BATCHIMPORT_HEAD] (BELEGKEY, Konto, Laufnummer, Auftragsnummer) VALUES (%InitialSQLResult%, '700131', NULL, NULL) UPDATE [CWLDATEN].[dbo].[t693] SET u003 = %InitialSQLResult% WHERE [u000] = 1
#Profile = MainLoopSQLQuery = INSERT INTO [CWLDATEN].[dbo].[t699] (u000, u001, u002, u003, u004, u005, u006, u007, u008, u009, u010, u011, u012, u013, u014, u015, u016, u029, u030) Select ISNULL(MAX(u000),0) + 1, %InitialSQLResult%, '%sourcefile%', '%column3%', '%column1%', '%column2%', '%column3%', '%column4%', '%column5%', '%column6%', '%column7%', '%column8%', '%column9%', '%column10%', '%column11%', '%column12%', '%column13%', getdate(), '%username%' FROM [CWLDATEN].[dbo].[t699]
#Profile = FinalSQLQuery =