Subject Re: translate error
From Mervyn Bick <invalid@invalid.invalid>
Date Wed, 31 May 2023 17:31:01 +0200
Newsgroups dbase.getting-started

On 2023/05/30 15:23, Charlie wrote:
> I have an xdml program that I have been running for years with no problem.  Around a month ago I noticed this error:
>
> database engine error.  translate error.  value out of bounds.
>
> The error is referring to line 69 which is:
>
> update on part_no from cgsold replace cuml with cuml + cgsold->cum random
>
> I have been ignoring the error and the program seems to finish successfully with no obvious errors.
>
> Could anyone tell me what the error is and/or what could cause it?  If someone has run into this error before how did you fix it?
>
> Not the end of the world but I would like to fix this if possible.
>
> Thanks for any help.

It's MANY years since I used XDML and, as far as I can remember, I've
never actually seen that error message before and it's not in the dBASE
2109 list of error messages. :-(

The wording of the message suggests that when the value in the cum field
for a part from the cgsold table is added to the value in the cuml field
in the main table the resulting value is too big to fit in the cuml
field in the main table.  You would need to increase the cuml filed size.

With the REPLACE command dBASE would give a similar error and would show
asterisks when the table is listed in the table browser.  The actual
value in the table would be truncated to fit the space available.  It is
possible that the UPDATE command is showing the error message and simply
moving on to the next record without changing anything.  This will, of
course, leave you with an error in your accumulated value.

Finding the culprit in a long table could be difficult.  Joining the two
tables and examining the result may make it easier.


Type the following as one line in the Command Panel and press Enter

Select m.part_no,m.cuml,c.cum,m.cuml+c.cum as tot from maintablename m
inner join cgsold c on m.part_no = c.part_no order by tot desc

Type BROWSE and press Enter.

The larger values will be at the top of the list and you should be able
to see if any value in the TOT field is likely to be too big to fit in
the main table's cuml field.

When you're done, type USE and press Enter to close the workarea.

Mervyn.