Integrating With Sybase Database (3.2.0)Last Updated: 12/03/2015 Introduced in Verision: 2.0 |
Database entities represent external databases which can be integrated with a flow. To add a database within the portal, navigate to the folder System > Designers > Integrations > Databases, click the Create Connection button, and supply the necessary details. Once a database is introduced, components to query, insert, or update data to or from the database within the Flow Designer can be used.
Example:
In this Example we are going to show how to Integrate with Sybase ODBC database. Next, we are going to create a Flow to view a table data from Sybase database and add a Row to the table in this database.
First, we need to integrate with Sybase database. In Portal, we navigate to System > Integrations > Databases folder and click Create Connection button from the Folder Actions panel.
In the resulting window we provide our database with the Name. From the Database Type dropdown we select ODBC.
Next, we need to provide a valid connection string for the database. In this Example we use a connection string of the following format:
Driver={ODBC Driver’s Name Here};server=nameOfTheServer;port=portNumber;db=databaseName;uid=login;pwd=password
Next, using ODBC DB Type Flow picker, we search and select Sybase ASE Flow.
Then, we click Test to test if we can connect to the database…
Decisions checks the connection…
And informs us that Connection Succeeded…
We click Ok to create the Connection to the database.
Then, we navigate to the Database Folder and click Add Table from the Folder Action panel.
In the resulting window we pick desirable Table, define fields that we want to use, define primary keys, and steps for System to generate. Click Ok to save table integration.
In the Databases Folder in Portal in Sybase database Folder our Table should be available now. Our table for this example looks as following…
To create a Flow we navigate to the Designer Folder and click Create Flow button from Folder Actions panel.
Next, we Name the Flow and click Create to proceed to the Flow Designer.
In the Flow Designer we expand Integrations > My Integrations > Database > SybaseTest(Database) > dbo.Names(Table) category in the Flow Designer Wizard and add Get all from dbo.Names step to our Flow.
Then, we use Flow Designer Wizard to connect Done outcome from Get all from dbo.Names step to Show Form step from Favorite Steps section.
Next, we Name our Form and click Create to proceed to the Form Designer.
For our Form we add a control Button from Actions category and rename it as Done. Next, we add Data Grid component from List category in the ToolBox.
We use Type picker to provide Type for our Data Grid. In the resulting Pick Type window we use a search bar to locate SybaseTest_dbo.Names [TableDefinition.Types] type.
This completes our Form Design. We can save the Form and close Form Designer to return back to the Flow Designer.
Back in the Flow Designer we connect Failed outcome from Get all from dbo.Names step to the End step in our Flow. Then, we locate Insert to dbo.Names step from Integrations > My Integrations > Database > SybaseTest(Database) > dbo.Names(Table) category in the Flow Designer Wizard and connect it to the Done outcome from our Form.
Next, we connect Failed outcome from Insert to dbo.Names step to the End Step in our Flow. Then, we add another Get all from dbo.Names step to our Flow and connect it to the Done outcome from Insert to dbo.Names step.
Then, we add another Form to the Done outcome from Get all from dbo.Names step using the Form that we created previously by adding it from Flows, Rules, Forms and Reports > Forms [Interaction] > [Current Folder] section.
This Form is a copy of the first Form that we used in our Flow. We connect Failed outcome from second Get all from dbo.Names step and Done outcome from the Second Form step to the End step in our Flow. Then, we select first Get all from dbo.Names step on the workspace and Ignore Limit Count input.
Next, we select First Form step on the workspace and using Select Value Mapping Type we Map data from the Get all from dbo.Names step’s outcome to the Grid Component on the Form.
Back in the Flow Designer we call Show Mapping Editor for our Insert to dbo_Names step.
In the Mapping Editor for the object to insert we use Build Array option and then we build our Row using Build Data and Constant Values for each field. Click Ok to save and close Mapping Editor.
Back in the Flow Designer we Ignore Limit Count for the second Get all from dbo.Names step.
Then, we select Second Form step and configure Data mapping in the exactly same manner we configured data for the first Form step in our Flow.
This completes our Flow. We click Debug Flow link from the top panel in the Flow Designer to test our Flow.
The First Form opens and we can observe that all 3 rows from our Table are displayed in the Data Grid on the Form. Click Done…
Second Form opens after the Row was inserted behind the scenes as we have designed. We can confirm that the new Row is present in the Data Grid on the Form. We click Done to terminate our Flow…
In the Diagram View in the Debugger we can see that our Flow ran to the End step with no issues.
If we query our database outside of Decisions we can see that a new row was added to the Names table.