vbace2
14 years agoOccasional Contributor
Project Variables - DB Table - DB2
Using TestComplete Enterprise version 8...
I created a DBTables store using an ODBC connection to a DB2 database. I actually used a query to pick the appropriate columns and rows I wanted. I was able to do this and get valid data from the DB2 database.
I then tried to create a DB Table variable for my project. Again, I tried to use an ODBC connection to the same database as I did for the store. I was able to connect to the database and I was able to see a list of tables. When I see the list of tables, it says at the top "Select a database table, view or query from which the DB Table variable will retrieve data.". When creating the store, I was able to specify a query. Here, it doesn't look like I can create a query. Also, if I select a table and click the View Table button, I get an error that says "Unable to display the table data. The following error occurred: [IBM][CLI Driver][DB2/NT]SQL0104N An unexpected token '* from' was found following 'select '. Expected tokens may include: '<value_expr_primary_or_stub>'. SQLSTATE=42601". I tried to use it in a script to see if it would work there. I tried to log the column count and I get pretty much the same message.
Am I doing something wrong? I seem to be able to create a store from the database just fine. I also seem to be able to pull up the tables when trying to create a DB Table variable for the project. It just doesn't seem to work correctly to retrieve the data. Maybe there is something wrong in the application?
If it helps, the following is what the default value shows for the DB Table variable. The connection string looks the same as the connection string for the store. The table only shows the table name though. I would have thought the schema name would be included in there all. The table isn't owned by the user, and the same name could be in multiple schemas.
{Table: "STABLE"; connection string: "Provider=MSDASQL.1;Password=dbpass;Persist Security Info=True;User ID=dbuser;Data Source=CARHORSD"}
Thanks
I created a DBTables store using an ODBC connection to a DB2 database. I actually used a query to pick the appropriate columns and rows I wanted. I was able to do this and get valid data from the DB2 database.
I then tried to create a DB Table variable for my project. Again, I tried to use an ODBC connection to the same database as I did for the store. I was able to connect to the database and I was able to see a list of tables. When I see the list of tables, it says at the top "Select a database table, view or query from which the DB Table variable will retrieve data.". When creating the store, I was able to specify a query. Here, it doesn't look like I can create a query. Also, if I select a table and click the View Table button, I get an error that says "Unable to display the table data. The following error occurred: [IBM][CLI Driver][DB2/NT]SQL0104N An unexpected token '* from' was found following 'select '. Expected tokens may include: '<value_expr_primary_or_stub>'. SQLSTATE=42601". I tried to use it in a script to see if it would work there. I tried to log the column count and I get pretty much the same message.
Am I doing something wrong? I seem to be able to create a store from the database just fine. I also seem to be able to pull up the tables when trying to create a DB Table variable for the project. It just doesn't seem to work correctly to retrieve the data. Maybe there is something wrong in the application?
If it helps, the following is what the default value shows for the DB Table variable. The connection string looks the same as the connection string for the store. The table only shows the table name though. I would have thought the schema name would be included in there all. The table isn't owned by the user, and the same name could be in multiple schemas.
{Table: "STABLE"; connection string: "Provider=MSDASQL.1;Password=dbpass;Persist Security Info=True;User ID=dbuser;Data Source=CARHORSD"}
Thanks