Jump to: navigation, search

Difference between revisions of "HowTo:Connect To Oracle With A Workflow"


Line 1: Line 1:
Before being able to connect to an oracle database it is necessary to configure the connection to the server on your local environment. UBIK uses OLEDB to connecti to Oracle via TNS (Transparent Network Substrate).
+
Prior to connecting to an Oracle database it is necessary to configure the connection to the server on your local environment. {{UBIK}} uses OLEDB to connecti to Oracle via TNS (Transparent Network Substrate).
1. After installing the oracle client you have to configure the oracle server in the TNS Names:
+
 
+
In [ORACLESOFTWARE]\network\admin\ you can find "tnsnames.ora".
+
Configure the connection and call it (like in this example TESTDB):
+
  
 +
= Instructions =
 +
# After the installation of the Oracle client you have to configure the Oracle server in the TNS Names:
 +
## Locate the file ''tnsnames.ora'' in the directory '''[ORACLESOFTWARE]\network\admin\'''
 +
## Configure the connection and call it (like in this example TESTDB):
 
<code>
 
<code>
 
TESTDB=
 
TESTDB=
Line 16: Line 16:
 
)
 
)
 
</code>
 
</code>
 +
# Use the [[CreateOLEOracleScope (Activity)}} activity to configure the connection via the arguments:
 +
#* the Oracle database '''DataSource'''
 +
#* the '''InitialCatalog'''
 +
#* '''UserName''' and '''Password'''
 +
# Use the [[CreateOLETableScope (Activity)]] activity or a [[CreateOLEQueryScope (Activity)]] to define the table you want to fetch data from. Set the tablename in the '''DisplayName''' argument.
 +
# Use a '''ForEach<DataRow>''' activity to iterate over the records fetched from the table.
 +
# A column of the recordset (table) can be accessed by its index.
  
 
+
=Example Workflows=
2. Use a "CreateOLEOracleScope" Activity to configure the connection.
+
Connecting to an Oracle database and fetching data with the CreateOLETableScope activity<br />
You have to configure the connection to the Oracle database DataSource, the InitialCatalog and you need to fill out UserName and Password.
+
[[File:ora_example_worfklow.JPG|440px|border|alt=Example Workflow|Example Workflow]]<br />
<br/><br/>
+
[[File:oratest.uwf|220px|border|alt=Example Workflow|Example Workflow]]
3. Use a "CreateOLETableScope" or a "CreateOLEQueryScope" to define the table you want to fetch data from.
+
Configure the tablename in DisplayName.
+
<br/><br/>
+
4. Use a ForEach<DataRow> Activity to iterate over the records in the table.
+
<br/><br/>
+
5. Access the columns of the record by using the index of the column.
+
<br/><br/>
+
 
+
 
+
'''Example Workflows:'''
+
<br/><br/>
+
Connecting to oracle DB and fetch data with a CreateOLETableScope: [[File:oratest.uwf|220px|border|alt=Example Workflow|Example Workflow]]
+
<br/><br/>
+
[[File:ora_example_worfklow.JPG|440px|border|alt=Example Workflow|Example Workflow]]
+
 
<br/><br/><br/>
 
<br/><br/><br/>
  

Revision as of 12:33, 11 February 2015

Prior to connecting to an Oracle database it is necessary to configure the connection to the server on your local environment. UBIK® uses OLEDB to connecti to Oracle via TNS (Transparent Network Substrate).

[edit]

Instructions

  1. After the installation of the Oracle client you have to configure the Oracle server in the TNS Names:
    1. Locate the file tnsnames.ora in the directory [ORACLESOFTWARE]\network\admin\
    2. Configure the connection and call it (like in this example TESTDB):

TESTDB=

(DESCRIPTION =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(Host =AUGTESTORACLE.cloudapp.net)(Port = 1521))
  )
(CONNECT_DATA =
  (SERVICE_NAME = UBIKTEST)
)

)

  1. Use the [[CreateOLEOracleScope (Activity)}} activity to configure the connection via the arguments:
    • the Oracle database DataSource
    • the InitialCatalog
    • UserName and Password
  2. Use the CreateOLETableScope (Activity) activity or a CreateOLEQueryScope (Activity) to define the table you want to fetch data from. Set the tablename in the DisplayName argument.
  3. Use a ForEach<DataRow> activity to iterate over the records fetched from the table.
  4. A column of the recordset (table) can be accessed by its index.

Example Workflows

Connecting to an Oracle database and fetching data with the CreateOLETableScope activity
Example Workflow
Oratest.uwf


Connecting to oracle DB and reading data with a CreateOLEQueryScope: Example workflow sql statement.uwf