MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error Inserting to ST_POLYGON column

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
ed.sam13
Beginner


Joined: 09 Aug 2010
Posts: 31
Topics: 11

PostPosted: Mon Sep 14, 2015 1:56 pm    Post subject: Error Inserting to ST_POLYGON column Reply with quote

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
View user's profile Send private message
ed.sam13
Beginner


Joined: 09 Aug 2010
Posts: 31
Topics: 11

PostPosted: Mon Sep 14, 2015 1:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Sep 14, 2015 4:24 pm    Post subject: Reply with quote

ed.sam13,

bonk

Please do NOT the same topic in multiple forums. you already posted here

http://www.mvsforums.com/helpboards/viewtopic.php?t=12576

and got an answer.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group