Skip to Content

Geo spatial method ST_POINT error

Hi All,

I am trying to use geo spatial method ST_POINT in my sql script when trying to insert data in geo spatial field i am getting below error:

"Could not execute 'INSERT INTO "NEO_B45RWNY007IMPIDRM4ZSG1OV0"."COMPLOC" VALUES('CHEN01','CHENNAI','TAMILNADU',new ...'

SAP DBTech JDBC: [270]: not enough values: ST_POINT('POINT(13.0878400 80.2784700)'): line 1 col 93 (at pos 92)"

Below is my table which i created with geo spatial data type:

create column table "NEO_B45RWNY007IMPIDRM4ZSG1OV0"."COMPLOC"(COMPID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,CITYID VARCHAR(6),CITY VARCHAR(30),STATE VARCHAR(30),

LONGLAT ST_GEOMETRY(4326));

Below is my insert statement in which am getting error:

INSERT INTO "NEO_B45RWNY007IMPIDRM4ZSG1OV0"."COMPLOC" VALUES('CHEN01','CHENNAI','TAMILNADU',new ST_POINT('POINT(13.0878400 80.2784700)'));

I am following exact syntax which was posted about this topic in other post's. Am i missing any parameter in ST_POINT.  Please help me in resolving this issue.

Thanks,

Rithika

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 31, 2015 at 12:34 PM

    You're leaving out the automatically generated COMPID column but you don't specify a column list with your INSERT statement.

    That's a bug in your code.

    Use INSERT INTO COMPLOC (CITYID, CITY, STATE, LONGLAT) VALUES (.... ) instead.

    Add comment
    10|10000 characters needed characters exceeded