SUBSTRING with WHERE clause in MSDASQL causes error

  • Thread starter Anastasya Knyazeva
  • Start date
Status
Not open for further replies.
A

Anastasya Knyazeva

Guest
I'm testing a feature in a Progress OpenEdge application that loads data into DB tables. Many of the fields in the table I'm testing are limited by our application to 256 characters, so I'm doing some edge case testing, trying to load in entries that are less than, equal to, and greater than 256 characters. After the data load, I query the DB and validate the results. I'm using the OLE DB provider for ODBC drivers through the testing program TestComplete. This is the query I'm using:

SELECT SUBSTRING(lname, 1, 30)
FROM pub.referral
WHERE lname LIKE 'valid%'


Before I run my test, the ODBC driver has no problem with this query. After I run it, though, there are fields in this table that have 256 characters, and the ODBC driver has problems with data of that length. I thought to avoid that by using SUBSTRING, but I still get a validation error when I try to use this query:

The specified query is invalid. Database engine reports: [DataDirect][ODBC Progress OpenEdge Wire Protocol driver]Error in row

Informative! That's the error I usually see when there's data in a table that's longer than ODBC likes. Strangely, though, if I take out the WHERE clause, the query validates and returns data in 30 character chunks, like I specified in the SUBSTRING.

Is this happening because I have more characters than the ODBC driver expects in a field, or because of something else having to do with the WHERE clause (incorrect syntax, etc.?) How can I get around this? I would like to do this without changing settings through dbtool - it's important to me to have the particular settings that I have in my DB in order for my tests to be accurate.

Continue reading...
 
Status
Not open for further replies.
Top