Search code examples
sql-serverparameter-passingautomationanywhere

Automation anywhere RPA


I did not find how to make use of add parameter when we use DB-sql commands in the process of using run stored procedure in AA client widget. I used the parameter but could not find where to assign value to this parameter in the wizard. Please share an example if possible with snapshot.

Thanks in Advance


Solution

  • Stored Procedure:

    ALTER PROCEDURE [dbo].[sp1]
    (
    @p1 VARCHAR(50),
    @p2 INT 
    )
    

    Option (1) You can take database command and select “Run Stored Procedure” In procedure name you can pass parameter as variable like this

    sp1('$a1$','$a2$')
    

    a1 and a2 are variables added in variable manager. (right side menu of client editor widget)

    If param1 value is integer you can pass it like sp1($param1$,'$param2$').

    For string parameter you need to put single quote.

    Image for option (1) ($a1$ is variable, 2 is fix integer value: p1 will get value of a1, p2 will get 2)

    enter image description here

    Option (2)

    Another option to provide static value in stored procedure, select Add Parameter option

    Procedure Name: sp1

    Add Parameter(s)

    Enter parameter value (Value of param1) and type and click on Add.

    Image for option (2) (p1 will get test123, p2 will get 1)

    enter image description here