SQL Node

      SQL Node


        Article summary

        SQL Node

        The SQL node uses a connection string to communicate with an SQL server. It can be used to run SQL queries within the Rayven workflow and will output the results in the payload for each applicable device.

        Adding a SQL node to your workflow

        1. First, select your desired solution and navigate to Rayven Workflow.
        2. Select ‘Inputs’ from the left-hand panel.
        3. Find the SQL node and drag it onto the canvas.
        4. Connect your SQL node to another node to provide an input.
        5. Double click on the SQL node to open its configuration window.

        Configuring your SQL node

        1. Give your node a name. Choose something simple that clearly explains its purpose. You must pick a name that has three or more characters.
        2. Select the Database Type for the SQL server you want to query from the drop-down options (MySQL or MSSQL).
        3. Enter the Connection String for the database.
        4. Enter the SQL Query. Use the notation [[my_field]] to take a field from the incoming JSON and place it in the query. If using the 'Auto Field Insert' checkbox, enter only the table name in this field.
        5. You can enter a Variable Name For Result if you want to define the name of the field that will contain the results from the SQL query.
        6. Auto Field Insert will query the database to get a list of fields in the table, check what fields with the same names exist in the JSON payload, then execute an INSERT for fields that exist in both. To use this option, enter only the table name in the SQL Query field.
        7. Check Use Replace Into if you want the Auto Field Insert to execute a 'REPLACE INTO' rather than an 'INSERT INTO' function. 

        Activation

        Once you have configured the node, click 'activate' and then 'save'. The node is now ready to send data into the workflow.


        See Also: Adding devices

        As of Release: 08.12.2021 



        What's Next