#################################################################################################### # 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\Export-DBDataToFile #################################################################################################### # 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 #==================================================================================================# ######################################## 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=SQL-SRV\;Initial Catalog=DD_ECM\;Trusted_Connection=True\;TrustServerCertificate=true\;" #==================================================================================================# ########################################## Profile Setup ########################################### #==================================================================================================# #################################################################################################### # Define Profiles in this config file for the executing Script. # # Syntax: # # Profile = ;;;;;# # ; # # Example: # # Profile = BulkExport ; E:\test ; Export_%Timestamp3%.json ; # # SELECT [UID] FROM [DD_ECM].[dbo].[VWCUST_EXPORT_OCR_TO_WAWI_TODO] ; [PRCUST_EXPORT_OCR_TO_WAWI] ;# # SELECT [FILE_CONTENT] FROM [DD_ECM].[dbo].[TBCUST_EXPORT_OCR_TO_WAWI_ARCHIVE] WHERE # # [INSIDERS_STACK_ID] = '%StackID%' and [FILE_NAME] = '%Filename%' # #--------------------------------------------------------------------------------------------------# # First Parameter: # # Determine which kind of export job should be done # # Example: BulkExport = Exports SQL Result straight to the determed file # #--------------------------------------------------------------------------------------------------# # Second Parameter: # # Give the Path where the export files should be stored # # You can use these placeholders: # # %Timestamp1% = 'ddMMyyyy' # # %Timestamp2% = 'ddMMyyyy_HHmmss' # # %Timestamp3% = 'ddMMyyyy_HHmmssffff' # # Example: E:\ExportPath\%Timestamp1% # #--------------------------------------------------------------------------------------------------# # Third Parameter: # # Set the export filename. # # You can use these placeholders: # # %Timestamp1% = 'ddMMyyyy' # # %Timestamp2% = 'ddMMyyyy_HHmmss' # # %Timestamp3% = 'ddMMyyyy_HHmmssffff' # # %StackID% = Result value from first sql query () # # Example: Export_%Timestamp3%.json # #--------------------------------------------------------------------------------------------------# # Fourth Parameter: # # SQL Query which should have one result column, with the StackIDs must be processed # # Example: SELECT [UID] FROM [DD_ECM].[dbo].[VWCUST_EXPORT_OCR_TO_WAWI_TODO] # #--------------------------------------------------------------------------------------------------# # Fifth Parameter: # # SQL Procedure which process the StackID from # # Example: [PRCUST_EXPORT_OCR_TO_WAWI] # #--------------------------------------------------------------------------------------------------# # Sixth Parameter: # # SQL Query which get the by processed DB lines # # Example: SELECT [FILE_CONTENT] FROM [DD_ECM].[dbo].[TBCUST_EXPORT_OCR_TO_WAWI_ARCHIVE] # # WHERE [INSIDERS_STACK_ID] = '%StackID%' and [FILE_NAME] = '%ExportFilename%' # #--------------------------------------------------------------------------------------------------# # Argument call: # # If you need to run the Script with dynamic Values, you can do so, by calling it with Arguments. # # Configured Profiles in INI-File will be ignored! # # The Arguments are the same as the Parameters in the configuration below. # # Every Argument can be used by position or name. # # Example: # # Export-DBDataToFile.ps1 "BulkExport" "E:\ExportPath" "Export_%Timestamp3%.json" "SELECT [UID] # # FROM [DD_ECM].[dbo].[VWCUST_EXPORT_OCR_TO_WAWI_TODO]" "[PRCUST_EXPORT_OCR_TO_WAWI]" # # "SELECT [FILE_CONTENT] FROM [DD_ECM].[dbo].[TBCUST_EXPORT_OCR_TO_WAWI_ARCHIVE] # # WHERE [INSIDERS_STACK_ID] = '%StackID%' # # and [FILE_NAME] = '%ExportFilename%' # # Example: # # Export-DBDataToFile.ps1 -pProfileType "BulkExport" -pExportPath "E:\ExportPath" # # -pExportFilename "Export_%Timestamp3%.json" -pExportSQLCheckQuery "SELECT [UID] FROM # # [DD_ECM].[dbo].[VWCUST_EXPORT_OCR_TO_WAWI_TODO]" # # -pExportSQLProcedure "[PRCUST_EXPORT_OCR_TO_WAWI]" # # -pExportSQLGetQuery "SELECT [FILE_CONTENT] FROM [DD_ECM].[dbo]. # # [TBCUST_EXPORT_OCR_TO_WAWI_ARCHIVE] WHERE [INSIDERS_STACK_ID] = '%StackID%' and # # [FILE_NAME] = '%ExportFilename%'" # #################################################################################################### Profile = BulkExport ; E:\ExportPath ; Export_%Timestamp3%.json ; SELECT [UID] FROM [DD_ECM].[dbo].[VWCUST_EXPORT_OCR_TO_WAWI_TODO] ; [PRCUST_EXPORT_OCR_TO_WAWI] ; SELECT [FILE_CONTENT] FROM [DD_ECM].[dbo].[TBCUST_EXPORT_OCR_TO_WAWI_ARCHIVE] WHERE [INSIDERS_STACK_ID] = '%StackID%' and [FILE_NAME] = '%ExportFilename%'