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

Mike Heins mike at perusion.com
Mon Aug 22 19:24:38 EDT 2005

Quoting maillists (lists at gmnet.net):
> Thanks again Mike,
> Sorry for the confusion. I will keep it short.  I am not using query to
> set this data. the query is only used to update another table later on.
> I am inserting a NEW record.
> This is the way I am inserting the new record with a form:
> I was once told that I need to set the value of "code" to NULL on the
> form in order for MySQL to create the new record. MySQL is doing all the
> auto_increment work.  It seems that MySQL is not telling IC what the new
> code is.
> <INPUT TYPE=HIDDEN NAME="mv_data_table"    VALUE="tablename">
> <INPUT TYPE=HIDDEN NAME="mv_data_key"      VALUE="code">
> <INPUT TYPE=HIDDEN NAME="mv_data_fields" VALUE="code">

If you have 

	Database tablename AUTO_SEQUENCE code_seq

in your configuration, it should indeed come back in $CGI->{code}
or $CGI->{return_code}. If you have not told IC that it is an
auto-increment with that configuration, I don't know what happens.

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

Getting old is tough. It's frustrating when you know all the
answers and nobody bothers to ask the questions. -- unknown

More information about the interchange-users mailing list