MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
ed.sam13 Beginner Joined: 09 Aug 2010 Posts: 31 Topics: 11
Posted: Mon Sep 14, 2015 1:56 pm Post subject: Error Inserting to ST_POLYGON column
The following is the definition of the DB2 table.
Code: CREATE TABLE
SAMPLE_GEOMETRIES
(
GEO_NAME CHAR(60) NOT NULL
FOR SBCS DATA
,GEOMETRY DB2GSE.ST_POLYGON)
I am using parameter markers in my Native SP to update GEOMETRY details on the table using for following dynamic SQL
Code: SET GEOM_STMT =
'INSERT INTO SAMPLE_GEOMETRIES ' ||
'(GEO_NAME, GEOMETRY) ' ||
'VALUES ' ||
'( ?,DB2GSE.ST_POLYGON(?,1)); ' ;
PREPARE STMT1 FROM GEOM_STMT;
EXECUTE STMT1 USING IN_STATE_CD, IN_POLYGON_COORDINATES;
During run time, the following are my parameters on DataStudio.
Code: IN_STATE_CD = "PMX"
IN_POLYGON_COORDINATES = 'POLYGON((-159.335174733889 21.9483433404175,-159.327130348878 22.0446395507162,-159.295025589769 22.1248124949548,-159.343195828355 22.1970166285359,-159.391366885913 22.2291198667724,-159.576012589057 22.2131796383001,-159.712505933171 22.1490592515515,-159.800814224332 22.0366665967853,-159.736592652746 21.9644203111023,-159.640246973766 21.9483657695954,-159.576021285803 21.8841361312636,-159.439545188912 21.8680716835921,-159.335174733889 21.9483433404175))'
Upon execution, I get SQLCODE = -245 for function DB2GSE.ST_POLYGON function.
How do I resolve this?
Back to top
ed.sam13 Beginner Joined: 09 Aug 2010 Posts: 31 Topics: 11
Posted: Mon Sep 14, 2015 1:58 pm Post subject:
Sorry forgot to mention, When I execute the following Static SQL, it goes thru
Code: INSERT INTO SAMPLE_GEOMETRIES
(GEO_NAME, GEOMETRY)
VALUES
( 'PMX',
DB2GSE.ST_POLYGON('POLYGON((
-159.335174733889 21.9483433404175,
-159.327130348878 22.0446395507162,
-159.295025589769 22.1248124949548,
-159.343195828355 22.1970166285359,
-159.391366885913 22.2291198667724,
-159.576012589057 22.2131796383001,
-159.712505933171 22.1490592515515,
-159.800814224332 22.0366665967853,
-159.736592652746 21.9644203111023,
-159.640246973766 21.9483657695954,
-159.576021285803 21.8841361312636,
-159.439545188912 21.8680716835921,
-159.335174733889 21.9483433404175))',1))
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum