IBM Informix Spatial DataBlade select statement error

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) 

Answers


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.


Need Your Help

Trying to Calculate logarithm base 10 without Math.h (Really close) Just having problems with connecting functions

c calculator logarithm

I'm trying to learn how to calculate the logarithm base 10 of any numbers that I enter via scanf to my code. I figure that I could calculate the ln(a) a being the number input. I have a working cod...

Displaying plist based on variable

ios nsarray nsdictionary

I am currently displaying my plist using the code below, which works, however this seems inefficient to me and I presume there is a cleaner approach.