Results 1 to 5 of 5
  1. #1

    How to pass variable to database parameter

    I am using QTP 9.1 with a web application.

    I have created a database check point and parameterized the field(so that I have column in the datatable now). In my script I have done some string manipulation to get a number and stored it in a variable. I am having a hard time trying to get the variable into the database checkpoint datatable column. I need to populate this datatable cell with the dynamic number so I can check that against what is in the database.

    I have tried this along with other things to no avail.

    DataTable.GetSheet("Global").AddParameter( "DbTable_Row_1Col_3", strFolderId)

    Any suggestions?


  2. #2

    Re: How to pass variable to database parameter

    Remove last brackets if you use it as Sub:
    DataTable.GetSheet("Global").AddParameter "DbTable_Row_1Col_3", strFolderId

    use it as Function (it will return value of the cell).
    Then, brackets are allowed.

    param = DataTable.GetSheet("Global").AddParameter "DbTable_Row_1Col_3", strFolderId

  3. #3

    Re: How to pass variable to database parameter

    Last line correction [img]/images/graemlins/smile.gif[/img]

    param = DataTable.GetSheet("Global").AddParameter("DbTable _Row_1Col_3", strFolderId)


  4. #4

    Re: How to pass variable to database parameter

    tsmith, I hope you have already parametrized the checkpoint for it to use DbTable_Row_1Col_3 and if that is the case then your global data table should already have that as one of the parameters. If yes then you can simply use

    DataTable("DbTable_Row_1Col_3") = strFolderId

    If not, then you need to use the technique mentioned by Janna

  5. #5

    Re: How to pass variable to database parameter

    Thanks all!! [img]/images/graemlins/smile.gif[/img]

    Tarun's suggestion worked for me because I had already parameterized the check point. I would like to know where that was in the help, I was looking all over to try to find this simple solution. [img]/images/graemlins/frown.gif[/img]




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:59 PM.

Copyright BetaSoft Inc.