# Jdbc problem when tracking column is fixed decimal

**URL:** <https://discuss.elastic.co/t/jdbc-problem-when-tracking-column-is-fixed-decimal/215051>\
**Category:** Logstash\
**Created:** [January 14, 2020, 9:38pm UTC](https://discuss.elastic.co/t/jdbc-problem-when-tracking-column-is-fixed-decimal/215051 "2020-01-14T21:38:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Li](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_li/32/109125_2.png) [@Peter\_Li](https://discuss.elastic.co/u/Peter_Li)\
**Post date:** [January 14, 2020, 9:38pm UTC](https://discuss.elastic.co/t/jdbc-problem-when-tracking-column-is-fixed-decimal/215051/1 "2020-01-14T21:38:53Z")

</div>

I have a table where the tracking value has to be constructed from two integers: batch and index.  
So, I created a fixed decimal "bistamp" like 123.0034, 124.0003, etc. using:

```auto
select
   ...
   to_number(to_char ( batch , 'FM999999' ) || '.' || to_char ( index , 'FM0000' ) , '999999.9999') as bistamp,
where
   ...
   to_number(to_char ( batch , 'FM999999' ) || '.' || to_char ( index , 'FM0000' ) , '999999.9999') > :sql_last_value

```

The problem is that $HOME/.logstash\_jdbc\_last\_run stores this number as:

--- !ruby/object:BigDecimal '0:0.70380003e4'

And on subsequent runs, the value for :sql\_last\_value is 0.

Is this a bug ?

Thanks,

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 11, 2020, 9:38pm UTC](https://discuss.elastic.co/t/jdbc-problem-when-tracking-column-is-fixed-decimal/215051/2 "2020-02-11T21:38:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
