Parameterizing static values in SQLs

When recording an installable cloud app to create the script, you would use static values for SQL statements (Retrieve, Select, etc.). It is not realistic to use the same value for all replays. Therefore, it is necessary to parameterize the static values.

Parameterize static values in Retrieve
  1. Find the static value in the Retrieve request body. You shall get it in the "arguments" node.

  2. Select the value, right click and select "Replace with Parameter" -> "Create new parameter".

  3. Enter the parameter name.

    In the example script below, the "customer_id" static value has been parameterized with the parameter <customerID>:

    web_custom_request("RetrieveWithParm", 
            "URL=http://172.16.9.79:5099/api/ServerApi/RetrieveWithParm", 
            "Method=POST", 
            "Resource=0", 
            "RecContentType=application/json", 
            "Referer=", 
            "Snapshot=t68.inf", 
            "Mode=HTTP", 
            "EncType=application/json;charset=UTF-8", 
            "Body={\"header\":[\"2.0\",1,\"psapi4loadrunner_cloud\",\"Psapi4loadrunner_cloud\",\"<gs_SessionID>\""
            ",\"<gs_TransactionID>\",\"sqlca\"],\"content\":{\"retrieves\":[{\"properties\":[\"21629E1F-F0B3-4dd4-B425-2729E8BAFA3A\",\"\",\"d_customer_pro\",\"\",false,false,\"\",\"\",1],\"arguments\":[[1,\"customer_id\",0,<customerID>]]}]}}", 
            LAST);
    
Parameterize static values in Select
  1. Find the static value in the Select request body. You shall get it in the "parameters" node.

  2. Select a value in the list of parameters, right click and select "Replace with Parameter" -> "Create new parameter".

  3. Enter the parameter name.

  4. Repeat step 2 to 3 until all values are parameterized

    In the example script below, the Select request has been parameterized with the parameters <customerID> and <NotName>:

    web_custom_request("SelectWithParm", 
            "URL=http://172.16.9.79:5099/api/ServerApi/SelectWithParm", 
            "Method=POST", 
            "Resource=0", 
            "RecContentType=application/json", 
            "Referer=", 
            "Snapshot=t77.inf", 
            "Mode=HTTP", 
            "EncType=application/json;charset=UTF-8", 
            "Body={\"header\":[\"2.0\",11,\"psapi4loadrunner_cloud\",\"Psapi4loadrunner_cloud\",\"<gs_SessionID>"
            "\",\"<gs_TransactionID>\",\"sqlca\"],\"content\":{\"modulename\":\"\",\"sqlid\":\"sqlHandle_01_DAB1222B\",\"parameters\":[[\"name\",2,<customerID>],[\"name\",8,\"<NotName>\"]]}}", 
            LAST);