- Mark Winsor
- PowerBuilder
- Tuesday, 14 May 2024 06:54 PM UTC
When converting an application from PB9 to PB2019 I get this error on the below datawindow. It appears to interpret the the string retrieval argument as a "text" datatype.
The error is: [ODBC 17 for SQL Server][SQL Server]The data types varchar and text are incompatible in the less then or equal to operator.
The SQL that generates the error is this:
SELECT routing.countrycode,
routing.startingpostalcode,
routing.endingpostalcode,
routing.routingcode
FROM routing
WHERE ( routing.countrycode = :CountryCode ) AND
( routing.startingpostalcode <= :PostalCode ) AND
( routing.endingpostalcode >= :PostalCode )
if I cast my retrieval argument to a varchar I can get it to work. Is there some setting somewhere that I am missing to make the syntax above work?
This SQL works:
SELECT routing.countrycode,
routing.startingpostalcode,
routing.endingpostalcode,
routing.routingcode
FROM routing
WHERE ( routing.countrycode = :CountryCode ) AND
( routing.startingpostalcode <= Cast(:PostalCode as varchar(6)) ) AND
( routing.endingpostalcode >= Cast(:PostalCode as varchar(6)) )
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.