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,
-Rick

Thanks!
Suran



Reply via email to