How to configure Database Activities?
Step By Step Guide
-
Excel
- Setup Environment
- Activities
- Connect
ConnectionString: "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\WORK\TestDB.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES;ReadOnly=0;"""
ProviderName: "System.Data.OleDb"
- Insert
Query with parameters example:
"INSERT INTO [CNDN_BY_AWB_HDR$] ([COMPANY_CODE],[CASE_ID],[REASON_CODE],[CREDIT_NOTE_TYPE],[ADJUSTMENT_TYPE],[INVOICE_NUMBER],[AWB_COUNT],[INVOICE_DATE],[SAP_SYSTEM],[PAPERFEE_ON_INVOICE],[EXCEPTION_FROM_REBOOKING_FEE]) VALUES (@CompanyCode,@CaseId,@ReasonCode,@CreditNoteType,@AdjustmentType,@InvoiceNumber,@AwbCount,@invoiceDate,@SapSystem,@PaperfeeOnInvoice,@ExceptionFee)"
- Connect
-
Access Database
- Setup Environment: Install DB2OLEDBV5_x64.msi
- Activities
- Connect
ConnectionString: "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\Users\ramona.cirstoiu\Documents\DatabaseTEST1.accdb;Persist Security Info=False;"
ProviderName: "System.Data.OleDb"
- Connect
-
SQL Server
- Setup Environment
- Activities
- Connect
ConnectionString: "Data Source=ROQAWSQL05;Initial Catalog=TESTDB;Persist Security Info=True;User ID=sa;Password=1qazXSW@"
ProviderName: "System.Data.SqlClient"
- Insert
Query with parameters example:
"INSERT INTO CNDN_BY_AWB_HDR (COMPANY_CODE,CASE_ID,REASON_CODE,CREDIT_NOTE_TYPE,ADJUSTMENT_TYPE,INVOICE_NUMBER,AWB_COUNT,INVOICE_DATE,SAP_SYSTEM,PAPERFEE_ON_INVOICE,EXCEPTION_FROM_REBOOKING_FEE) VALUES (@CompanyCode,@CaseId,@ReasonCode,@CreditNoteType,@AdjustmentType,@InvoiceNumber,@AwbCount,@invoiceDate,@SapSystem,@PaperfeeOnInvoice,@ExceptionFee)"
- Connect
-
Oracle
- Setup Environment
-
Install Oracle Instant Client and ODBC Package (both of them 32 bit - http://www.oracle.com/technetwork/database/windows/index-098976.html). Run the odbc_install.exe file.
-
Locate the tnsnames.ora file (you can also copy it in the instant client folder).
-
Add to System Variables:
-> Add to PATH the folder where the Instant Client is (for example, c:\Apps\instantclient_12_2)-> Create new System variable TNS_ADMIN which points to the folder where tnsnames.ora is located (for example, c:\Apps\instantclient_12_2)
-
In ODBC Data Source Administrator (32 bit), System DSN tab, add a new System Data Source and use the "Oracle in instantclient" driver. Test the connection. (see attached screenshot, OracleODBC).
-
- Activities
- Connect
ConnectionString: "Dsn=ORACLE_DSN;Uid=testuser;Pwd=testpass;"
ProviderName: "System.Data.Odbc"
- Insert
Query without parameters example:
"INSERT INTO CNDN_BY_AWB_HDR (COMPANY_CODE,CASE_ID,REASON_CODE,CREDIT_NOTE_TYPE,ADJUSTMENT_TYPE,INVOICE_NUMBER,AWB_COUNT,INVOICE_DATE,SAP_SYSTEM,PAPERFEE_ON_INVOICE,EXCEPTION_FROM_REBOOKING_FEE) VALUES (‘CompanyCode’,’CaseId’,’ReasonCode’,’CreditNoteType’,’AdjustmentType’,’InvoiceNumber’,’AwbCount’,’invoiceDate’,’SapSystem’,’PaperfeeOnInvoice’,’ExceptionFee’)"
Query with parameters example:
"INSERT INTO CNDN_BY_AWB_HDR (COMPANY_CODE,CASE_ID,REASON_CODE,CREDIT_NOTE_TYPE,ADJUSTMENT_TYPE,INVOICE_NUMBER,AWB_COUNT,INVOICE_DATE,SAP_SYSTEM,PAPERFEE_ON_INVOICE,EXCEPTION_FROM_REBOOKING_FEE) VALUES (:CompanyCode,:CaseId,:ReasonCode,:CreditNoteType,:AdjustmentType,:InvoiceNumber,:AwbCount,:invoiceDate,:SapSystem,:PaperfeeOnInvoice,:ExceptionFee)"
- Connect
- Setup Environment