When I Execute the following Select Statement I am getting Arithmetic overflow occured.
But my scenario is quiet different.
I am using PowerBuilder as my client application development tool.
In that, When I execute,
Select Isnull(Max(PersonCode),0)+1 Into :NextPerson From Person
PersonCode is of type Numeric(6,0).
Personcode is the PrimaryKey and it has already 10500 rows.
Variable is of type long which can accomodate upto (-2,147,483,648 to +2,147,483,647).
If I execute the above statment in the SQL Query Analyzer, it executes well and it returns the maximum + 1 value.
If I execute the same through my PowerBuilder application, it gives this error.
This is very very urgent.