Thanks,

I'm a little disappointed that DDL isn't supported in some shape or form. After all, iBATIS does claim to provide me with 'the full power of SQL'. However, I suppose that as iBATIS is aimed at mapping data objects to relational tables, perhaps DDL doesn't really fit within the brief.

Anyhow, that aside, any thoughts on the best way to get around this limitation? Perhaps retrieving the connection from the SQLMapClient and performing operations directly?

David

Larry Meadors wrote:

First off, DDL is unsupported. If it works, swell; If not, bummer.

You may be able to do the insert using $substitution$ and #parameters#
with iterate tags - I have never tried that, but give it a shot - it
may work.

Larry


On 11/1/05, David Moss <[EMAIL PROTECTED]> wrote:
Hi,

I'm trying to create a system that dynamically generates a table and
inserts content according to the attributes of a dynamic data set (from
imported files).  The data is actually from ESRI shape files, which
require a table each for their attribute information.

I believe that I've been able to set up the table as required with the
following...

   <update id="createGeomTable" parameterClass="VectorTableAttributes" >
       create table #tableName# (#gid# serial
       <iterate prepend="," property="columnNames" conjunction=",">
           columnNames[] varchar
       <iterate>
       , CONSTRAINT #tableName#_pkey PRIMARY KEY (#gid#))
   <update>

   <update id="addGeomColumn" parameterClass="VectorTableAttributes" >
       select
   AddGeometryColumn('ecorisk',#tableName#,#geom#,'-1',#geometryType#,2)
       <!--inserting data into a PostGIS database -->
   </update>

   <insert id="addGeometryTableEntry"
   parameterClass="com.graticule.ecorisk.bus.beans.sets.VectorTableEntry">
       insert into #tableName# (???????) values (??????) .......
   </insert>


However, I have a couple of questions...

  1. Is it possible to combine several SQL statements into a single
     <statement></statement> block?  e.g. could I combine
     "createGeomTable" and "addGeomColumn" (I suspect not)?
  2. What would be the best way of inserting the data.  As I don't know
     the field names in advance I can't code them in.  I thought I
     might be able to use a java.util.Map within VectorTableEntry to
     map the column names to the column values but can't see how I
     could get this to work.



Any help / thoughts / experiences in this would be great.

Ta!

David.


--
**********************************************************************
* The information in this message is confidential and is for         *
* the addressee(s) only.  If you have received this message in error,*
* please notify the sender. Unauthorised use,disclosure,duplication  *
* or alteration of this message are forbidden. This message and any  *
* attachments have been scanned for viruses. Graticule will not be   *
* liable for direct, indirect or consequential damages arising from  *
* altering the contents of this message by a third party or as a     *
* result of any virus being passed on.                               *
* ------------------------------------------------------------------ *
* Unless stated otherwise - prices quoted in this e-mail are in      *
*  British Pounds Sterling and exclude media charges, package and    *
*  postage and Value Added Tax (VAT), where applicable. Prices are   *
*  valid for a period of 30 days from the date of this e-mail. Annual*
*  renewal fees are subject to change without notice. Transactions   *
*  are subject to our Terms of Business:                             *
*  (http://www.graticule.com/company/terms.pdf).                     *
**********************************************************************

Reply via email to