db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <rick.hille...@oracle.com>
Subject Re: Creating tables - migrating from MySQL.
Date Tue, 21 Jan 2014 21:04:28 GMT
On 1/21/14 11:39 AM, Paul Linehan wrote:
> 2014/1/21 Rick Hillegas<rick.hillegas@oracle.com>:
> Hi Rick, and thanks for your input.
>> You might want to take a look at the optional foreignViews tool, which can
>> be useful for data migration projects like yours:
>> http://db.apache.org/derby/docs/10.10/tools/rtoolsoptforeignviews.html. You
>> can create and populate a Derby table from an external table by following
>> the instructions for loading the foreignViews tool and then issuing
>> statements like the following:
>> -- create the local Derby table
>> create table S1.T1 as select * from XYZ_S1.T1 with no data;
>> insert into S1.T1 select * from XYZ_S1.T1;
> I had a quick look at this - launch it from within ij>!
> I didn't construct my URL properly and got a suitable error message.
> Just wondering - how will this cope with ENUM types? Tinytext? Mediumtext?
Not sure. The foreign data type is converted to a Derby datatype by 
org.apache.derby.impl.tools.optional.ForeignDBViews.mapType(). It's all 
based on column type information which is returned by 
DatabaseMetaData.getColumns(). But I don't know what MySQL's 
DatabaseMetaData.getColumns() returns for enum, tinytext, and mediumtext 

If something bad happens, let me know. I may be able to improve the tool.
> In the meantime, I've about 50% of a tool which will get me to where I
> want - very
> crude, but it should cover the basics - I'll have a couple of weeks
> after Thursday
> and might be able to thrash out something usable. I will experiment
> with what you've
> showed me - again after Thursday.
> I'm Setting Mediumtext and Longtext to BLOB - hope this is OK?
CLOB might be better but BLOB could work. Note that you won't be able to 
use CLOBs or BLOBs in ordered contexts (like GROUP BY and ORDER BY 
clauses and in comparisons involving the <, >, and = operators).

Hope this helps,
> Thanks again and rgs,
> Paul...
>> -Rick

View raw message