This error would be returned if, after the cursor/SELECT has already
encountered an error (for example, a data exception), the
application/interface attempts to reposition the cursor using an
absolute or relative fetch.
My guess is that the SELECT caused a data exception. The domain of the
ASCII function is CHAR and its domain is INTEGER; ASCII(128) is 49
(convert the integer 128 to a string ('128'), return the ascii value of
the first character ('1') which is 49. Unlikely what you want.
Since ASCII returns an int, the mixed-type comparison
substr(HISTHD.GTD_NUMBER,1,1) <> ascii(128)
will take place in a NUMERIC domain - and if any GTD_NUMBER begins with
any non-numeric character, a data exception will occur.
Glenn
Robert Paresi wrote:
Quote:
Hi,
I am using the latest V11 database and I get the following error message:
"Cursor not in a valid state"
What does that mean???
SELECT
PREFIX+' '+FIRSTNAME+' '+LASTNAME AS Line1,
COMPANY AS Line2,
STREET AS Line3,
CITY + ', ' + STATE + ' ' + ZIPCODE AS Line4,
COUNTRY AS Line5,gtd_number
FROM HISTHD
WHERE CITY <> ' ' AND STATE <> ' ' AND ZIPCODE <> ' '
and HISTHD.GTD_NUMBER <> '' and substr(HISTHD.GTD_NUMBER,1,1)
ascii(128) |
--
Glenn Paulley
Director, Engineering (Query Processing)
Sybase iAnywhere
Blog: http://iablog.sybase.com/paulley
EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all
To Submit Bug Reports: http://case-express.sybase.com
SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288
Whitepapers, TechDocs, and bug fixes are all available through the
Sybase iAnywhere pages at
http://www.sybase.com/products/datab...chnicalsupport