Forum Discussion

swahla's avatar
swahla
Occasional Contributor
2 years ago

Reading table schema from redshift

When i read any values from a table in testcomplete, that works but when I read column names and try to copy them in a list in python, there seems to be a limit of 7 characters and any column names that are longer than that are read as null. How can I solve this problem in test complete.

3 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Using the Object Spy tool, and checking the column names, is it greater than 7 characters? If yes, then can you post your code with the issue please?

    • swahla's avatar
      swahla
      Occasional Contributor

      Hi rraghvani from the results I get, I assume there is some limit, but now that I looked at it again, it seems 10 characters. If my actual query returns 

      column_name
      test_attr_boolean
      row_id
      data_version
      created_by
      created_at
      updated_at
      updated_by

      RecSet.Fields.Item[i].Value returns me only row_id, created_by , created_at , updated_at, updated_by.

       

      while not RecSet.EOF:
        for i in range(0 , RecSet.Fields.Count):
          var = RecSet.Fields.Item[i].Value
          dbResult.append(var)
          counter += 1
         RecSet.MoveNext()

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    If your values are correct, but the table names are short, then most likely it will be the ODBC driver that you are using, is limiting the length.