Sorry, the mail client dropped the schema, I hope this will handle attachments


On 7/19/06, Thomas Dudziak <[EMAIL PROTECTED] > wrote:
On 7/19/06, Obs <[EMAIL PROTECTED] > wrote:

> Can anyone explain this? I used the DatabaseIO to read in a schema I just
> generated.  For some reason, it's trying to read the foreign key as a
> column.

I'm not sure what you mean ? Could you post the original schema for
the table, the generated SQL (which database is it, btw ?), and the
resulting schema ?

Tom



--
Obs
I modified the Database.initialize() to write out the columns and their types.  
Also, the identity insert is failing as well, using sql server 2000.

nActionTakenID : INTEGER
szActionTaken : VARCHAR
nAddressAlternateID : INTEGER
szFirstName : VARCHAR
szLastName : VARCHAR
szAddress1 : VARCHAR
szAddress2 : VARCHAR
szAddress3 : VARCHAR
szStateProv : VARCHAR
szPostalCode : VARCHAR
szCity : VARCHAR
nCountryFK : INTEGER
FK_tb_AddressAlternate_tb_Country : null


org.apache.ddlutils.model.ModelException: The column nr. 10 in table 
tb_AddressAlternate has no type
        at org.apache.ddlutils.model.Database.initialize(Database.java:303)
        at org.apache.ddlutils.io.DatabaseIO.read(DatabaseIO.java:163)
        at com.creative.db.DataCopy.importData(DataCopy.java:80)
        at com.creative.db.DatabaseTest.readFromDatabase(DatabaseTest.java:52)
        at com.creative.db.DatabaseCopy.main(DatabaseCopy.java:15)



<database name="db_CLARMA">

    <table name="tb_AddressAlternate">
      
        <column name="nAddressAlternateID" primaryKey="true" required="true" 
type="INTEGER" size="10" autoIncrement="true"/>
      
        <column name="szFirstName" primaryKey="false" required="true" 
type="VARCHAR" size="32" autoIncrement="false"/>
        <column name="szLastName" primaryKey="false" required="true" 
type="VARCHAR" size="32" autoIncrement="false"/>
      
        <column name="szAddress1" primaryKey="false" required="false" 
type="VARCHAR" size="32" autoIncrement="false"/>
      
        <column name="szAddress2" primaryKey="false" required="false" 
type="VARCHAR" size="32" autoIncrement="false"/>
      
        <column name="szAddress3" primaryKey="false" required="false" 
type="VARCHAR" size="32" autoIncrement="false"/>
      
        <column name="szStateProv" primaryKey="false" required="false" 
type="VARCHAR" size="32" autoIncrement="false"/>
      
        <column name="szPostalCode" primaryKey="false" required="false" 
type="VARCHAR" size="16" autoIncrement="false"/>
      
        <column name="szCity" primaryKey="false" required="false" 
type="VARCHAR" size="32" autoIncrement="false"/>
      
        <column name="nCountryFK" primaryKey="false" required="false" 
type="INTEGER" size="10" autoIncrement="false"/>
      
        <foreign-key foreignTable="tb_Country" 
name="FK_tb_AddressAlternate_tb_Country">
        
                <reference local="nCountryFK" foreign="nCountryID"/>
      
        </foreign-key>
    
    </table>
    
    <table name="tb_Country">
      
        <column name="nCountryID" primaryKey="true" required="true" 
type="INTEGER" size="10" autoIncrement="false"/>
      
        <column name="szCountryName" primaryKey="false" required="false" 
type="VARCHAR" size="50" autoIncrement="false"/>
      
        <column name="szCountryISOCode" primaryKey="false" required="false" 
type="VARCHAR" size="10" autoIncrement="false"/>
      
        <column name="nTaxTypeFK" primaryKey="false" required="false" 
type="INTEGER" size="10" autoIncrement="false"/>
      
        <column name="dtDateModified" primaryKey="false" required="false" 
type="TIMESTAMP" size="23,3" autoIncrement="false"/>
      
        <column name="szPostalCodeFormat" primaryKey="false" required="false" 
type="VARCHAR" size="64" autoIncrement="false"/>
      
        <column name="bCurrencyUseCommaForPeriod" primaryKey="false" 
required="false" type="BIT" size="1" autoIncrement="false"/>
      
        <column name="nLSOFK" primaryKey="false" required="false" 
type="INTEGER" size="10" autoIncrement="false"/>
      
        <column name="nRegionFK" primaryKey="false" required="false" 
type="INTEGER" size="10" autoIncrement="false"/>
      
        <column name="nCurrencyFK" primaryKey="false" required="false" 
type="INTEGER" size="10" autoIncrement="false"/>
      
        <column name="nLanguageFK" primaryKey="false" required="false" 
type="INTEGER" size="10" autoIncrement="false"/>
    
    </table>
  
</database>

Reply via email to