Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

Activities



Connect to SQL

This activity connects to a SQL Host. The Output of this activity should be used as input for all Connection parameters used for activities placed under PostgreSQL category.


NOTE: If during the execution of the workflow, the connection expires, the activity will attempt three times to automatically reconnect to SQL host using the input credentials. 

Activity Parameters

The Connect to SQL activity parameters can be provided by manual inserted values or via IN arguments or variables:


Parameters:

  • Database (text box editor type) (type: string)the database name to connect to.
  • Password (password editor type) (type: string): the password for the username provided in Username parameter for PostgreSQL Authentication.
  • Password Binding (text box editor type) (type: string): Bind to a variable containing the encrypted password for the username provided in Username parameter for SQL Authentication. (This parameter is used only when the user wants to send an encrypted password from outside the workflow, for example Flowster Portal). In case of Windows Authentication, if the user that connects to the database is the logged in one, the field can remain empty.
  • Port (text box editor type) (type: int32)the port number for the PostgreSQL Server.
  • Server Name (text box editor type) (type: string)the name or IP of the SQL Server to connect to. If it is a local SQL server, localhost is also accepted as a value.
  • Username (text box editor type) (type: string): the SQL username for SQL Authentication. E.g 'demouser' which represents the Login name of type PostgreSQL Server authentication.

The Read Only Output variable are the possible output values that the activity will provide:

  • Connection (type: object)outputs a SQL connection. The Output of this activity should be used as input for all Connection parameters used for activities placed under Microsoft SQL category.
 





Disconnect from PostgreSQL

This activity disconnects from a SQL Host.

Activity Parameters

The Disconnect from PostgreSQL activity parameters can be provided by manual inserted values or via IN arguments or variables:



Parameters:

  • Connection (text box editor type) (type: object): the output from a Connect to MSSQL activity.



Add Role Access to Database

This activity adds privileges for an user to a database.

Activity Parameters

The Add Role Access to Database activity parameters can be provided by manual inserted values or via IN arguments or variables:



Parameters:

  • Connection (text box editor type) (type: object): SQL Host connection. The Output from Connect to SQL activity should be used as Input here
  • Role (text box editor type) (type: string ): Enter the name of the role that will receive permissions 
 


The Read Only Output variable are the possible output values that the activity will provide:

  • Output (type: Boolean): Outputs True or False if the execution was successful or not.




Delete Row(s) from Table

This activity deletes Row(s) from a SQL Server database table.

Activity Parameters

The Delete Row(s) from Table activity parameters can be provided by manual inserted values or via IN arguments or variables:



Parameters:

  • Table (text box editor type) (type: string): the table name where the row(s) will be deleted from.
  • Where Statement (text box editor type) (type: string): the Where statement to filter the row(s) that will be deleted. For example: ID>2, where all rows with an ID higher than 2 will be deleted.

Execution: the activity will delete all the rows from a table according to the given Where statement:

  • the initial table content:



  • the table content after deletion:


 


Insert Row into Table

This activity inserts Row on a SQL Server database table.

Activity Parameters

The Insert Row into Table activity parameters can be provided by manual inserted values or via IN arguments or variables:



Parameters:

  • Fields (text box editor type) (type: string): the column headers that you want to be returned with the select command. If you enter more than one you should separate them with ','. For example: Name,Surname,Company.
  • Table (text box editor type) (type: string): the table name where the row(s) will be inserted.
  • Values (text box editor type) (type: string): the values for specified fields in Fields parameter. If you enter more than one you should separate them with ','. If you have more values each should be placed in the same order as you add the fields.For example: May,James,Amazon Prime.

The Read Only Output variable are the possible output values that the activity will provide:

  • Output Last ID (type: string): outputs the last row inserted ID.
 

Execution: the activity will insert the new row into the selected table and will output the ID of the added row:



In the database, the row can be seen at the last position:


 


Remove Role Access from Database

This activity removes privileges for an user to a database.

Activity Parameters

The Remove Role Access from Database activity parameters can be provided by manual inserted values or via IN arguments or variables:


Parameters:

  • Connection (text box editor type) (type: object): the connection object that was obtained as output from a Connect To OracleSQL activity.
  • Role (value selector list) (type: string): the roles that will be added to the user. The roles will be selected from a list, after clicking the ... button. The list will display all possible roles that can be assigned to a SQL user.
  •  


    The Read Only Output variable are the possible output values that the activity will provide:

    • Output (type: boolean): outputs True or False if the execution was successful or not.



Execution: the activity will check if the user exists as a login on the SQL server and if found and if it already have assigned rights to the database where the activity is connected to. If the user is found and has rights over the database,  the activity will revoke access on the connected database, for the given roles:


 



 


Run query

This activity runs a query on a SQL Server database.

Activity Parameters

The Run Query activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

  • Query (text box editor type) (type: string): the SQL query string. For example: "SELECT Name, Company FROM [FlowsterMSSQLActivities].[dbo].[Names] where ID>1 and ID<4 order by name ASC"

NOTE: if query returns a column of Date type, the format of the date returned as a string will be taken from the execution server.

  • Script (text box editor type) (type: string): the query content if a binding to a variable is used ($using). If set and if the $using:variable syntax is used, this parameter will take precedence over the Query parameter. For example, the $using:DemoString syntax will take the value stored in the DemoString variable and will execute it:

The Read Only Output variable are the possible output values that the activity will provide:

  • Output (type: collection<collection<string>>): outputs a collection of returned rows.To use the elements of the collection, use ForEachFactory activity.
  • Output Columns (type: int32): outputs the number of columns returned.
  • Output Rows (type: int32): outputs the number of rows returned.
 

NOTE: if user-defined messages are desired to be returned and displayed by the Run Query activity, the command(s) can be written by following the example below:

DECLARE @firstMessage char(20);
DECLARE @secondMessage char(20);
SET @firstMessage='The selected category exists in the database';
SET @secondStatus = 'The selected category does not exist in the database';

IF (EXISTS (SELECT name FROM Category where name='Approval Tasks'))
SELECT @firstMessage;
ELSE
SELECT @secondMessage;



Execution: In the Tracking Data there can be seen the returned results:


The same result can be seen when executing the same SQL Select query from SQL Management Studio:




Select Row(s) from Table

This activity selects and returns Row(s) from a SQL Server database table. The example below displays a classic select query: select all data from a given table.

Activity Parameters

The Select Row(s) from Table activity parameters can be provided by manual inserted values or via IN arguments or variables:

Parameters:

  • Distinct (combo box control)  (type: string): whether the returned values should be distinct or not.
  • Fields (text box editor type) (type: string): the column headers that you want to be returned with the select command. If you enter more than one you should separate them with ','. If all fields needs to be returned, then just use "*". The " * " has the same role as used in the SQL select all statement: select * from table
  • Limit (text box editor type) (type: string): limit the number of results. If the field is left blank, then the activity will return all the rows from the table
  • Order By (text box editor type) (type: string): the column header that you want to result to be ordered by. For example, if "ID" is inserted, then the values returned will be ordered depending on the value set in the ID column. If no value is provided, the activity will return the values in the same order as taken from the table. 
  • Order by Direction (combo box control) (type: string)choose to order the resulted rows in Ascending or Descending direction. It will be ignored if Order By is not set.
  • Table (text box editor type) (type: string): the table name on which to run the select.
  • WHERE (text box editor type) (type: string)the Where statement. For example: ID>2, where ID is a column header.


The Read Only Output variable are the possible output values that the activity will provide:

  • Output (type: collection<collection<string>>): outputs a collection of collections of strings containing the selected rows.To use the elements of the collection, use Get Element From Collection activity.
  • Output Columns (type: int32): outputs the number of columns returned.
  • Output Rows (type: int32): outputs the number of rows returned.
 


A more complex example, with fields, orders and statements can be seen in the image below:

Execution: In the Tracking Data there can be seen the returned results:


The same result can be seen when executing the same SQL Select query from SQL Management Studio:



  • No labels