views:

41

answers:

1

Hi

I am using IBM informix spatial datablade module for some geo specific data. I am trying to find points in table xmlData lying in a specified region. But i am getting this error for select statement.

SELECT sa.pre, sa.post 
FROM xmlData sa 
WHERE ST_Contains(('polygon((2 2,6 2,6 6,2 6,2 2)),sa.point)

    Query:
    select count(*) as mycnt fromText('polygon((2 2,6 2,6 6,2 6,2 2))',6),sa.point)
    Error: -201
    [Informix][Informix ODBC Driver][Informix]A syntax error has occurred.
    (SQLPrepare[-201] at /work/lwchan/workspace/OATPHPcompile/pdo_informix/
     pdo_informix/informix_driver.c:131) 
A: 

The statement:

select count(*) as mycnt fromText('polygon((2 2,6 2,6 6,2 6,2 2))',6),sa.point)

is ill-formed; it has no 'FROM' clause. Presumably, there is a space missing between 'FROM' and 'TEXT' in 'fromText'.

Be aware that TEXT is a data type in Informix. I don't think it will cause problems here using it as a table name, but be cautious.

Jonathan Leffler