[ic] return value of autonumber or code at time of INSERT

Mike Heins mike at perusion.com
Tue Aug 23 15:41:56 EDT 2005


Quoting maillists (lists at gmnet.net):
> 
> This is in my catalog.cfg: ##########
> ###################################################
> Database tablename AUTO_SEQUENCE code_seq <<-- I'm not sure what this
> does?
> 
> This is part of my tablename.mysql and i rebuilt the database with
> Interchange restart. ############
> ###################################################
> Database  tablename  tablename.txt __SQLDSN__
> Database  tablename  AUTO_NUMBER  00101

Those two are incompatible. If you are using AUTO_NUMBER, it is not
the same as AUTO_SEQUENCE.

AUTO_NUMBER uses an Interchange file counter to assign the ids. This
doesn't work with the form-based insert.

AUTO_SEQUENCE uses MySQL auto_increment to do the same (or Postgres
sequences if that is used). It should work with the form.

> Database  tablename  KEY          code
> Database  tablename  COLUMN_DEF   "code=INT(20) NOT NULL PRIMARY KEY"

If your table was built with this definition, you are not using
auto_increment.

You can rebuild your table using this:

    Database tablename AUTO_SEQUENCE code_seq

That will replace the two lines:

    Database  tablename  AUTO_NUMBER  00101
    Database  tablename  COLUMN_DEF   "code=INT(20) NOT NULL PRIMARY KEY"

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

Unix version of an Outlook-style virus:
It works on the honor system. Please forward this message to everyone
you know, and delete a bunch of your files at random.


More information about the interchange-users mailing list