How to get bigInt number more than 15 characters from the database and put it in a string

Hi,

I have a problem when I retrieve the data by in_TransactionItem.SpecificContent(“num_doc”).ToString. If I look in the queue the data appears correct 7202122951679869, but when I put it in the num_doc variable it changes to “7.20212295167987E+15”.

I don’t know if it’s related, but this data is in the database as bigInt.

I’m using REFramework framework.

Can you help me. Thanks!

Hi @Daniel_Santos1

Can you please let us know, how are you adding format of the data to the Queue

Thanks

Yes sure,

I do a select in the database, the return I create a datatable and put it in the queue.

image

Thanks.

Hi @Daniel_Santos1

Can you please try changing the datatype of numdoc in database as varchar2 and try it.

Thanks

no, in database i is not allowed to change column type.

The strange thing is that in the queue he enters with the correct format. Only when I put it on the variable does it change.
image

Also I can see there a numeric value after the numdoc is it achieved as expected?

Thanks

Yes,

Queue item

image

in studio

image

Hi @Daniel_Santos1

Could you please try these

CDbl(in_TransactionItem.SpecificContent("num_doc")).ToString("F")

or

CDbl(in_TransactionItem.SpecificContent("num_doc")).ToString("F0")

or

CDec(in_TransactionItem.SpecificContent("num_doc")).ToString

or
Change the data type of NumeroDocumento to System.Decimal

@kumar.varun2

I did the tests here see the returns. The problem was that he raised the number up.

Queue

image

Studio:

image

changing the type of the variable caused an error.

Thanks

Hi guys, thanks a lot for the tips.

I managed to get around the problem. Forcing to concatenate a letter with a number in the select in the database. This caused the number to be interpreted by uipath as a string.

Look

select id,cnpj, num_doc_ajustado = concat ([num_doc],‘a’), data_hora, razao_social, local_arq

from [bdp].[dbo].[compr]
where cnpj in (6xxx55320143,8xx58002,102xxx0000121,42xxx000167,8xxx49130500009)
and dsc_stat = ‘CONCLUIDO’
order by dat_hora_ult_alt desc

image

1 Like

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