db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: Sequences: Constraints for optional arguments
Date Wed, 20 Jan 2010 14:20:07 GMT
Suran Jayathilaka wrote:
> Hi Rick,
> Thank you for your reply.
> Since the datatype of the sequence object can be either Smallint, Int 
> or Bigint, when the datatype is SMALLINT or INTEGER, is it necessary 
> to check whether the arguments for Min-value, Max-value,Initial-Value 
> etc. (if explicitly provided),  are within range for the given data type?
> e.g. For a SMALLINT datatyped Sequence object, check whether minValue 
> >= Short.MIN_VALUE and maxValue <= Short.MAX_VALUE
Yes, please. That is my understanding of the ANSI/ISO spec, part 2, 
section 9.24 <Creation of a sequence generator>, syntax rule 9.
> If so, is the init() method or the bindStatement() method of 
> CreateSequenceNode the correct place to do it? What kind of exception 
> should be thrown in such a case with the exception message ID 22003?
This kind of check is typically done during the bind() phase. I would 
recommend performing these checks in bindStatement().

> Thanks!
> Suran

View raw message