Documentation

SQLDumphandler function

This function s used to dump the resultant output of SQL query into a given excel file.

Select SET command from the action dropdown and provide a variable name in Element key where output will be stored, edit parameter section and click on Form, select functions from the dropdown and select SQLDUMPHANDLER function. Provide connName and queryName defined in settings, varData if there is any, file path, alias, and type.

When type=query

Above Example is with type as query

When type=SP

Above Example is with type as SP(Stored Procedure)

Here, connName is defined under Settings > DB settings

In the above snapshot we have db connection details under default database connection. So connName will be default or you can leave it as blank.

In case there are multiple databases integrated with your project as given below:

In this case connName will be either default, sql or mysql as highlighted in the above snapshot depending upon from which database you want to fetch the data.

queryName is defined in Data > Manage SQL Scripts

In the above snapshot, highlighted name will be the query name.

varData is given when you want to parametrize your sql query by giving some input from here. For Example if you have a sql query written as given below:

Now instead of hardcoding emp_no=’4′ , you can parameterize and pass the value of emp_no from the varData field. In that case you will have to use a variable along with @ sign in your sql query as shown below:

Now, in you will pass the value of num variable from the varData field as shown below:

Syntax for above varData= variable name : value

filePath is excel file path where resultant query data will be dumped

alias name is a variable name that will be used for further reference

type defines the type of query like normal sql or stored procedure(SP). So the type will be either query in case of normal sql queries or SP in case of stored procedure.

If data is dumped successfully in the given file then it will return true in the variable defined in the Element key else it will return false. After completing this step it will look as below:

Was this page helpful?