116 lines
21 KiB
INI
116 lines
21 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\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 = <ProfileType>;<ExportPath>;<ExportFilename>;<ExportSQLCheckQuery>;<ExportSQLProcedure>;#
|
|
# <ExportSQLGetQuery>; #
|
|
# 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: <ProfileType> #
|
|
# Determine which kind of export job should be done #
|
|
# Example: BulkExport = Exports SQL Result straight to the determed file #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Second Parameter: <ExportPath> #
|
|
# 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: <ExportFilename> #
|
|
# Set the export filename. #
|
|
# You can use these placeholders: #
|
|
# %Timestamp1% = 'ddMMyyyy' #
|
|
# %Timestamp2% = 'ddMMyyyy_HHmmss' #
|
|
# %Timestamp3% = 'ddMMyyyy_HHmmssffff' #
|
|
# %StackID% = Result value from first sql query (<SQLQuery>) #
|
|
# Example: Export_%Timestamp3%.json #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Fourth Parameter: <ExportSQLCheckQuery> #
|
|
# 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: <ExportSQLProcedure> #
|
|
# SQL Procedure which process the StackID from <ExportSQLCheckQuery> #
|
|
# Example: [PRCUST_EXPORT_OCR_TO_WAWI] #
|
|
#--------------------------------------------------------------------------------------------------#
|
|
# Sixth Parameter: <ExportSQLGetQuery> #
|
|
# SQL Query which get the by <ExportSQLProcedure> 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%' |