I had a similar problem a while ago and I got round it by using a trigger -
called a function on an insert to
read a value from a table (use for update when selecting)
update with incremented value
then use the return value from the ffunction to "set" the new value -
you can do all your login or
Hi,
> > CREATE TABLE competenza (
> > competenza varchar(30) NOT NULL default 'comp-06-',
> > id_competenza int unsigned not null auto_increment,
> > descrizione varchar(100),
> > PRIMARY KEY (competenza, id_competenza)
> > )
> >
> > Since your PRIMARY KEY is a combination of 2 fields (competenza
On Tuesday 02 January 2007 16:51 Brent Baisley's cat, walking on the keyboard,
wrote:
> CREATE TABLE competenza (
> competenza varchar(30) NOT NULL default 'comp-06-',
> id_competenza int unsigned not null auto_increment,
> descrizione varchar(100),
> PRIMARY KEY (competenza, id_competenza)
> )
>
I don't think MySQL has exactly what you are looking for, but you may be able
to get the behavior you want.
The auto_increment value is actually based on an index and doesn't have to be unique. So you could create a compound index that has
one or more fields plus the auto_increment field. The e
Hi,
> I'm new to MySQL coming from PostgreSQL backgroud. I'd like to know how to
> obtain the same effect of a sequence + concat as default value of a table
in
> mysql. For example, consider the following table definition:
>
> CREATE TABLE competenza
> (
> id_competenza character varying(30) NOT