Hi,

I am currently using SQLAlchemy in the creation of a mysql database. I
use alchemy to create the tables and to access them but I use a python
script to collect the information from the necessary sources prepare
them and shove them into tab delimited 'out' files which i then load
into the tables using the mysql 'LOAD IN FILE' function.

These are my tables

AccessionsTable = Table('AccessionsTable',metadata,
        Column('accession_number', String(20), primary_key=True),
        Column('description',String(300)),
        Column('seq_length',Integer),
        Column('accessions_id',Integer)
        )
AccessionsTable.create()

InstancesTable = Table('InstancesTable',metadata,
        Column('inst_id',Integer,primary_key=True,autoincrement=True),
        Column('oligomer',String(40)),
        Column('instances', String),
        Column('frequency',Integer),
        Column('fisher_coef', Float),
        Column('expectation_per_100kb', String),
        
Column('accession_number',String(20),ForeignKey('AccessionsTable.accession_number'))
        )
InstancesTable.create()


OligosTable = Table('OligosTable', metadata,
        Column('oligomer',String(40),ForeignKey('InstancesTable.oligomer'),
primary_key=True),
        Column('word', String),
        Column('word_length', Integer),
        Column('descriptor', Integer),
        Column('gc_cont', Float),
        Column('melt_temp_wall', Float),
        Column('melt_temp_nn', Float)
        )
OligosTable.create()

This is what the command looks like

LOAD DATA INFILE '/db/test/01.ins' INTO TABLE InstancesTable FIELDS
TERMINATED BY '\t' LINES TERMINATED BY '\n';

My problem is that this specific table - InstancesTable has an
autoincremented primary key which was intended to be generated
automatically however the first value in each line in the file is
being shoved into it which breaks the operation. I am just curious if
theres an attribute i can specify for this column when i create the
table so that this doesnt happen.

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to