Forum Discussion

DKNP's avatar
DKNP
Occasional Contributor
8 years ago

DBTable - Interacting with a DBTable if it is a passed parameter to a function\routine

Hi   I currently have a DB table variable which is a variable of a keyword test. The DBTable is pointing to a spreadsheet stored on the local computer.   The keyword test calls a function and I p...
  • tristaanogre's avatar
    tristaanogre
    8 years ago

    Just as a note, I tried it and it's working fine for me.  I have an Excel spreadsheet with two columns in it: Value1 and Value2.  I have that spreadsheet assigned to a DBTable variable on a keyword test.  I then pass that variable to the following function.  My log shows the values of each column for each row as I iterate through the rows from beginning to end.

     

    function testDBTable(myTable) {
    
        while (!myTable.IsEOF()) {
            Log.Message('Column 1 data: ' + myTable.Value('Value1'));
            Log.Message('Column 2 data: ' + myTable.Value('Value2'));
            myTable.Next();
        }
    }
  • DKNP's avatar
    DKNP
    8 years ago

    Thanks, that works.