Convert from varchar to int without losing data

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
jalfonso
Posts: 26
Joined: 2020-05-05 17:36
Location: Canary Islands

Convert from varchar to int without losing data

Post by jalfonso » 2023-03-21 17:08

Hello, people. I need to convert a varchar field from the index of a table to integer (it has only numbers). If I modify in the Appgini application the data type it keeps/converts the numbers from char to int without losing data?

Thanks!

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1150
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Convert from varchar to int without losing data

Post by onoehring » 2023-03-24 09:31

Hi,

when you change the field type of a varchar that holds only integers, nothing should be lost. Just make sure you backup your database first ;-)

Olaf

jalfonso
Posts: 26
Joined: 2020-05-05 17:36
Location: Canary Islands

Re: Convert from varchar to int without losing data

Post by jalfonso » 2023-03-27 22:25

Thanks for replying! I did a test with the database with a local copy in the database and it actually worked. I did it with the database in production (fingers crossed and all that) and it did too. What I don't understand is that in Oracle, to do the same thing, I needed to generate field, cast, and replace index... the appgini rebuild fields option works fine but I miss being able to manipulate it.

Great work!

Post Reply