dbTalk Databases Forums  

column_schema.setDefault problem

sybase.public.sqlanywhere.ultralite sybase.public.sqlanywhere.ultralite


Discuss column_schema.setDefault problem in the sybase.public.sqlanywhere.ultralite forum.

Reply
 
Thread Tools Display Modes
  #11  
Old   
Nick Elson [Sybase iAnywhere]
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-17-2008 , 05:18 PM






Version 11 documents

ColumnSchema.COLUMN_DEFAULT_AUTOINC
and
ColumnSchema.setDefault

[see:
http://dcx.sybase.com/index.php#http...-autoinc0.html
or
http://dcx.sybase.com/index.php#http...307492134.html ]

Maybe one of those will work for you with V10.


"GUO Lin" <guolin.mobi (AT) gmail (DOT) com> wrote

Quote:

It is about SQL UltraliteJ.

I have updated to the forth EBF release.
But I have still the problem about the function setDefault

1 : column_schema.setDefault( COLUMN_DEFAULT_GLOBAL_AUTOINC )

I define the table schema like this:

conn.schemaCreateBegin();
ColumnSchema column_schema;
TableSchema table_schema = conn.createTable("INTERVENTIONS");

column_schema = table_schema.createColumn( "id", Domain.INTEGER );
column_schema.setNullable( false );

column_schema.setDefault( ColumnSchema.COLUMN_DEFAULT_GLOBAL_AUTOINC );

column_schema = table_schema.createColumn( "description",
Domain.VARCHAR, 512 );
column_schema.setNullable( true );
column_schema = table_schema.createColumn( "statut",
Domain.INTEGER);
column_schema.setNullable( true );
column_schema = table_schema.createColumn( "duree",
Domain.INTEGER );
column_schema.setNullable( true );
column_schema = table_schema.createColumn( "idtechnicien",
Domain.INTEGER);
column_schema.setNullable( true );
...

IndexSchema index_schema =
table_schema.createPrimaryIndex( "primary" );
index_schema.addColumn( "id", IndexSchema.ASCENDING );
conn.schemaCreateComplete();

When I insert data into this table, I receive an exception :
ULjException: ianywhere.ultralitej.implementation.JrException:
UltraLiteJ Error[-195]: Column 'id' in table 'INTERVENTIONS' cannot be
NULL

2: We have the function getLastIdentity of interface connection in M-
business.
But We have not the equivalencie in UltralitJ, has anyone good
solution of getting the last identity ?





Reply With Quote
  #12  
Old   
Nick Elson [Sybase iAnywhere]
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-17-2008 , 05:18 PM






Version 11 documents

ColumnSchema.COLUMN_DEFAULT_AUTOINC
and
ColumnSchema.setDefault

[see:
http://dcx.sybase.com/index.php#http...-autoinc0.html
or
http://dcx.sybase.com/index.php#http...307492134.html ]

Maybe one of those will work for you with V10.


"GUO Lin" <guolin.mobi (AT) gmail (DOT) com> wrote

Quote:

It is about SQL UltraliteJ.

I have updated to the forth EBF release.
But I have still the problem about the function setDefault

1 : column_schema.setDefault( COLUMN_DEFAULT_GLOBAL_AUTOINC )

I define the table schema like this:

conn.schemaCreateBegin();
ColumnSchema column_schema;
TableSchema table_schema = conn.createTable("INTERVENTIONS");

column_schema = table_schema.createColumn( "id", Domain.INTEGER );
column_schema.setNullable( false );

column_schema.setDefault( ColumnSchema.COLUMN_DEFAULT_GLOBAL_AUTOINC );

column_schema = table_schema.createColumn( "description",
Domain.VARCHAR, 512 );
column_schema.setNullable( true );
column_schema = table_schema.createColumn( "statut",
Domain.INTEGER);
column_schema.setNullable( true );
column_schema = table_schema.createColumn( "duree",
Domain.INTEGER );
column_schema.setNullable( true );
column_schema = table_schema.createColumn( "idtechnicien",
Domain.INTEGER);
column_schema.setNullable( true );
...

IndexSchema index_schema =
table_schema.createPrimaryIndex( "primary" );
index_schema.addColumn( "id", IndexSchema.ASCENDING );
conn.schemaCreateComplete();

When I insert data into this table, I receive an exception :
ULjException: ianywhere.ultralitej.implementation.JrException:
UltraLiteJ Error[-195]: Column 'id' in table 'INTERVENTIONS' cannot be
NULL

2: We have the function getLastIdentity of interface connection in M-
business.
But We have not the equivalencie in UltralitJ, has anyone good
solution of getting the last identity ?



Reply With Quote
  #13  
Old   
GUO Lin
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-21-2008 , 03:53 AM



Hi, Nick

I read the document many time.
In fact, I found and reported the bug to Tom slee that
ColumnSchema.COLUMN_DEFAULT_AUTOINC can not work when we reconnect the
base in last release.

And I thought that you would fix the bug about ColumnSchema
( COLUMN_DEFAULT_AUTOINC and COLUMN_DEFAULT_GLOBAL_AUTOINC ).

Now the problem is about COLUMN_DEFAULT_GLOBAL_AUTOINC.
I tested it in the forth EBF release. It does not work. You can see
the trace in the first article.
So I pose this problem here.

Lin







Reply With Quote
  #14  
Old   
GUO Lin
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-21-2008 , 03:53 AM



Hi, Nick

I read the document many time.
In fact, I found and reported the bug to Tom slee that
ColumnSchema.COLUMN_DEFAULT_AUTOINC can not work when we reconnect the
base in last release.

And I thought that you would fix the bug about ColumnSchema
( COLUMN_DEFAULT_AUTOINC and COLUMN_DEFAULT_GLOBAL_AUTOINC ).

Now the problem is about COLUMN_DEFAULT_GLOBAL_AUTOINC.
I tested it in the forth EBF release. It does not work. You can see
the trace in the first article.
So I pose this problem here.

Lin







Reply With Quote
  #15  
Old   
GUO Lin
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-21-2008 , 03:53 AM



Hi, Nick

I read the document many time.
In fact, I found and reported the bug to Tom slee that
ColumnSchema.COLUMN_DEFAULT_AUTOINC can not work when we reconnect the
base in last release.

And I thought that you would fix the bug about ColumnSchema
( COLUMN_DEFAULT_AUTOINC and COLUMN_DEFAULT_GLOBAL_AUTOINC ).

Now the problem is about COLUMN_DEFAULT_GLOBAL_AUTOINC.
I tested it in the forth EBF release. It does not work. You can see
the trace in the first article.
So I pose this problem here.

Lin







Reply With Quote
  #16  
Old   
GUO Lin
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-21-2008 , 03:53 AM



Hi, Nick

I read the document many time.
In fact, I found and reported the bug to Tom slee that
ColumnSchema.COLUMN_DEFAULT_AUTOINC can not work when we reconnect the
base in last release.

And I thought that you would fix the bug about ColumnSchema
( COLUMN_DEFAULT_AUTOINC and COLUMN_DEFAULT_GLOBAL_AUTOINC ).

Now the problem is about COLUMN_DEFAULT_GLOBAL_AUTOINC.
I tested it in the forth EBF release. It does not work. You can see
the trace in the first article.
So I pose this problem here.

Lin







Reply With Quote
  #17  
Old   
GUO Lin
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-21-2008 , 03:53 AM



Hi, Nick

I read the document many time.
In fact, I found and reported the bug to Tom slee that
ColumnSchema.COLUMN_DEFAULT_AUTOINC can not work when we reconnect the
base in last release.

And I thought that you would fix the bug about ColumnSchema
( COLUMN_DEFAULT_AUTOINC and COLUMN_DEFAULT_GLOBAL_AUTOINC ).

Now the problem is about COLUMN_DEFAULT_GLOBAL_AUTOINC.
I tested it in the forth EBF release. It does not work. You can see
the trace in the first article.
So I pose this problem here.

Lin







Reply With Quote
  #18  
Old   
GUO Lin
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-21-2008 , 03:53 AM



Hi, Nick

I read the document many time.
In fact, I found and reported the bug to Tom slee that
ColumnSchema.COLUMN_DEFAULT_AUTOINC can not work when we reconnect the
base in last release.

And I thought that you would fix the bug about ColumnSchema
( COLUMN_DEFAULT_AUTOINC and COLUMN_DEFAULT_GLOBAL_AUTOINC ).

Now the problem is about COLUMN_DEFAULT_GLOBAL_AUTOINC.
I tested it in the forth EBF release. It does not work. You can see
the trace in the first article.
So I pose this problem here.

Lin







Reply With Quote
  #19  
Old   
GUO Lin
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-21-2008 , 03:53 AM



Hi, Nick

I read the document many time.
In fact, I found and reported the bug to Tom slee that
ColumnSchema.COLUMN_DEFAULT_AUTOINC can not work when we reconnect the
base in last release.

And I thought that you would fix the bug about ColumnSchema
( COLUMN_DEFAULT_AUTOINC and COLUMN_DEFAULT_GLOBAL_AUTOINC ).

Now the problem is about COLUMN_DEFAULT_GLOBAL_AUTOINC.
I tested it in the forth EBF release. It does not work. You can see
the trace in the first article.
So I pose this problem here.

Lin







Reply With Quote
  #20  
Old   
GUO Lin
 
Posts: n/a

Default Re: column_schema.setDefault problem - 10-21-2008 , 03:53 AM






Hi, Nick

I read the document many time.
In fact, I found and reported the bug to Tom slee that
ColumnSchema.COLUMN_DEFAULT_AUTOINC can not work when we reconnect the
base in last release.

And I thought that you would fix the bug about ColumnSchema
( COLUMN_DEFAULT_AUTOINC and COLUMN_DEFAULT_GLOBAL_AUTOINC ).

Now the problem is about COLUMN_DEFAULT_GLOBAL_AUTOINC.
I tested it in the forth EBF release. It does not work. You can see
the trace in the first article.
So I pose this problem here.

Lin







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.