cancel
Showing results for 
Search instead for 
Did you mean: 

Geo spatial method ST_POINT error

former_member224444
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

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.

former_member224444
Participant
0 Kudos

Thanks Lars,

It solved my issue...

Answers (0)