Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread
Message: 98158
BY: Brandon Medenwald (bmedenwald)
DATE: 2012-07-30 16:08
SUBJECT: DB2 GeoSpatial Transform Group

 

I'm using DB2 GepSpatial Extender, Rails and the Spatial Adapter gem. In order to get this gem working, I need to tell DB2 to use the default transform group ST_WELLKNOWNBINARY, which allows the database to speak the right language.

I've had this working in the past, but now this doesn't seem to work no matter how hard I try. I've boiled it down to these steps within a transaction:

1. Set the default transform group
2. Check the value to make sure it happened
3. Try to run my SQL

However, the SQL I try to run always errors out by saying: a transform group "DB2_PROGRAM" is not defined. This is the behavior that should happen if a default wasn't specified, but since I've specified and checked it worked right above this, I don't understand how it isn't being adhered to. The ST_WELLKNOWNBINARY transform group is a DB2 default, so it should just work.

Here's some logging to illustrate my steps:

120730 10:56:05 [DEBUG]:: (1.3ms) SET CURRENT DEFAULT TRANSFORM GROUP = ST_WellKnownBinary
120730 10:56:05 [DEBUG]:: (1.3ms) values (current default transform group)
120730 10:56:05 [DEBUG]:: Values: ST_WELLKNOWNBINARY
120730 10:56:06 [DEBUG]:: SQL (8.9ms) INSERT INTO saved_poly (coords, link_id, ma_tech_id, mod_timestamp, polygon, table_name, tech_id) VALUES (?, ?, ?, ?, ?, ?, ?)
120730 10:56:06 [DEBUG]:: RuntimeError: Failed to prepare sql INSERT INTO saved_poly (coords, link_id, ma_tech_id, mod_timestamp, polygon, table_name, tech_id) VALUES (?, ?, ?, ?, ?, ?, ?) due to: [IBM][CLI Driver][DB2/LINUXX8664] SQL20015N A transform group "DB2_PROGRAM" is not defined for data type "DB2GSE.ST_POLYGON". SQLSTATE=42741 SQLCODE=-20015: INSERT INTO saved_poly (coords, link_id, ma_tech_id, mod_timestamp, polygon, table_name, tech_id) VALUES (?, ?, ?, ?, ?, ?, ?)
120730 10:56:06 [FATAL]:: ActiveRecord::StatementInvalid: while copying search with message RuntimeError: Failed to prepare sql INSERT INTO saved_poly (coords, link_id, ma_tech_id, mod_timestamp, polygon, table_name, tech_id) VALUES (?, ?, ?, ?, ?, ?, ?) due to: [IBM][CLI Driver][DB2/LINUXX8664] SQL20015N A transform group "DB2_PROGRAM" is not defined for data type "DB2GSE.ST_POLYGON". SQLSTATE=42741 SQLCODE=-20015: INSERT INTO saved_poly (coords, link_id, ma_tech_id, mod_timestamp, polygon, table_name, tech_id) VALUES (?, ?, ?, ?, ?, ?, ?)


I'm using ibm_db 2.5.10 and Rails 3.1.


Thread View

Thread Author Date
DB2 GeoSpatial Transform GroupBrandon Medenwald2012-07-30 16:08
      RE: DB2 GeoSpatial Transform GroupPraveen Devarao2012-07-30 16:46
            RE: DB2 GeoSpatial Transform GroupBrandon Medenwald2012-07-30 19:51
            RE: DB2 GeoSpatial Transform GroupBrandon Medenwald2012-08-13 13:58
                  RE: DB2 GeoSpatial Transform GroupDavid Adler2012-08-13 14:29
                        RE: DB2 GeoSpatial Transform GroupBrandon Medenwald2012-08-13 15:16
                              RE: DB2 GeoSpatial Transform GroupDavid Adler2012-08-13 15:49
                                    RE: DB2 GeoSpatial Transform GroupBrandon Medenwald2012-08-13 15:55
                                    RE: DB2 GeoSpatial Transform GroupBrandon Medenwald2012-08-14 14:07
      RE: DB2 GeoSpatial Transform GroupDavid Adler2012-08-15 14:57

Post a followup to this message