Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
replied

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.

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question