db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mamta Satoor <msat...@gmail.com>
Subject Re: [jira] Commented: (DERBY-167) Inserting values in an identity column
Date Wed, 13 Apr 2005 18:41:05 GMT
Hi Tomohito,

That sounds like the right thing to do to support GENERATED BY DEFAULT
AS IDENTITY and GENERATED ALWAYS AS IDENTITY as 2 possible options on
a column.

Mamta

On 4/13/05, TomohitoNakayama <tomonaka@basil.ocn.ne.jp> wrote:
> Hello.
> 
> I was continuing to read code around DERBY-167 and
> found class org.apache.derby.impl.sql.catalog.SYSCOLUMNSRowFactory.
> This class seems to convert information between ExecRow and
> ColumnDescriptor.
> 
> According to the code of this class, ExecRow seems to have information for
> columns indexed by next...
> 
> protected static final int  SYSCOLUMNS_REFERENCEID = 1;
> protected static final int  SYSCOLUMNS_COLUMNNAME = 2;
> protected static final int  SYSCOLUMNS_COLUMNNUMBER = 3;
> protected static final int  SYSCOLUMNS_COLUMNDATATYPE = 4;
> protected static final int  SYSCOLUMNS_COLUMNDEFAULT = 5;
> protected static final int  SYSCOLUMNS_COLUMNDEFAULTID = 6;
> protected static final int   SYSCOLUMNS_AUTOINCREMENTVALUE = 7;
> protected static final int   SYSCOLUMNS_AUTOINCREMENTSTART = 8;
> protected static final int  SYSCOLUMNS_AUTOINCREMENTINC = 9;
> 
> I think it is needed  to support GENERATED BY DEFAULT adding new information
> to those above, like next.
> +protected static final int  SYSCOLUMNS_AUTOINCREMENTRESTRICTED= 10;
> If value of this information was 1, user can't insert value in the column.
> If value of this information was 0, user can insert value in the column ,
> and if user didn't auto increment value are inserted.
> 
> Best regards.
> 
> /*
> 
>         Tomohito Nakayama
>         tomoihto@rose.zero.ad.jp
>         tomonaka@basil.ocn.ne.jp
> 
>         Naka
>         http://www5.ocn.ne.jp/~tomohito/TopPage.html
> 
> */
> ----- Original Message -----
> From: "Tomohito Nakayama (JIRA)" <derby-dev@db.apache.org>
> To: <derby-dev@db.apache.org>
> Sent: Thursday, April 07, 2005 1:09 AM
> Subject: [jira] Commented: (DERBY-167) Inserting values in an identity
> column
> 
> >     [
> > http://issues.apache.org/jira/browse/DERBY-167?page=comments#action_62281
> > ]
> >
> > Tomohito Nakayama commented on DERBY-167:
> > -----------------------------------------
> >
> > Reading source codes relating to DERBY-167 and found next constructors.
> >
> > ColumnDescriptor(java.lang.String columnName, int columnPosition,
> > DataTypeDescriptor columnType, DataValueDescriptor columnDefault,
> > DefaultInfo columnDefaultInfo, TableDescriptor table, UUID defaultUUID,
> > long
> > autoincStart, long autoincInc, boolean autoinc)
> >          Constructor for a ColumnDescriptor
> > ColumnDescriptor(java.lang.String columnName, int columnPosition,
> > DataTypeDescriptor columnType, DataValueDescriptor columnDefault,
> > DefaultInfo columnDefaultInfo, UUID uuid, UUID defaultUUID, long
> > autoincStart, long autoincInc, boolean autoinc)
> >          Constructor for a ColumnDescriptor.
> >
> >
> > These constructors have many parameters.
> >
> > AutoIncrementing intial value is related to  following parameters:
> >    long autoincStart,
> >    long autoincInc,
> >    boolean autoinc
> > Default intial value is related to following parameter:
> >    DefaultInfo columnDefaultInfo
> >
> >
> > I wonder how to handle these separated information of rules for initial
> > values in DERBY-167 task ....
> > New class InitialValueRule may be appropriate to exist ....
> >
> >> Inserting values in an identity column
> >> --------------------------------------
> >>
> >>          Key: DERBY-167
> >>          URL: http://issues.apache.org/jira/browse/DERBY-167
> >>      Project: Derby
> >>         Type: Improvement
> >>   Components: SQL
> >>     Versions: 10.1.0.0
> >>  Environment: SQL
> >>     Reporter: Christian Rodriguez
> >
> >>
> >> It is not possible to insert a specific value in a column defined as
> >> identity. This makes it very hard to migrate from other RDBMSs or to
> >> import data dumped from other databases.
> >> For example, an autoincrement column in MySQL should be an identity
> >> column. The problem is that when the data is dumped from MySQL to a file,
> >> it generates inserts with values. These values cant be inserted in the
> >> Derby table.
> >> Posible solutions: 1. being able to "generate by default as identity" 2.
> >> being able to disable the "identity" feature for a column 3. being able
> >> to generate a column as non identity and after data is populated, alter
> >> table to add the "identity" to the column.
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > If you think it was sent incorrectly contact one of the administrators:
> >   http://issues.apache.org/jira/secure/Administrators.jspa
> > -
> > If you want more information on JIRA, or have a bug to report see:
> >   http://www.atlassian.com/software/jira
> >
> >
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.308 / Virus Database: 266.9.3 - Release Date: 2005/04/05
> >
> >
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 2005/04/12
> 
>

Mime
View raw message