Add record data with the prefix 0 (zero)

Add record data with the prefix 0 (zero)

  

i want to make database with the prefix 0 (zero), i already ms excel. example data : id = 001, idNumber = 001, Nations = Indonesia. but when in outsystems 001 so 1, 002 so 2. what should i do ?


Hello Zainal

What I think you should do is change the data type of idNumber to text. That way I think the platform will keep the zeros in that field.

Bear in mind that you will still need an id attribute (the primary key of the table) which will most likely be an autonumber, and therefore, won't have the prefix 0. Your table should look a bit like
id    |     idNumber (type: text)    |   Name

1           001                                   Indonesia


Hope this helps

Regards,

Ângelo

Ângelo Sousa wrote:

Hello Zainal

What I think you should do is change the data type of idNumber to text. That way I think the platform will keep the zeros in that field.

Bear in mind that you will still need an id attribute (the primary key of the table) which will most likely be an autonumber, and therefore, won't have the prefix 0. Your table should look a bit like
id    |     idNumber (type: text)    |   Name

1           001                                   Indonesia


Hope this helps

Regards,

Ângelo

Hai Angelo Sousa

thanks for your reply. I've done that. I also tried the data type integer, text, decimal but the result is the same


Check the type in Structure (should be named like the Excel). It also needs to be Text or else you are doing a Text to Integer to Text conversion and losing the 0.

Hi Zainal,

DataType for value which you want to store like '001' should be text in database and you if you are using structure to showing the data then datatype of column of structure should be text in this way you can solve your problem.


Regards

-SK-

Hey Zainal,

This is a nice example of difference between data and information.
Data is raw and unprocessed, whereas information is understandable for humans.

You want to turn this 1 into a 001, so why not do so when you are presenting the data?
It doesn't always make sense to store "information" in the database.

Or you could as others have suggested, add a new column with datatype of text, which prefills the number with 0's until a specific length has been reached.

Hello Claring

Do you mean treat the id field at the screen level? For example, if Zainal is showing a list of details in a table records, you are suggesting he displays the id in a column and concatenates it with a 0 string? That's actually an interesting idea, that wouldn't require an extra attribute.


Regards,

Ângelo

Ângelo Sousa wrote:

Hello Claring

Do you mean treat the id field at the screen level? For example, if Zainal is showing a list of details in a table records, you are suggesting he displays the id in a column and concatenates it with a 0 string? That's actually an interesting idea, that wouldn't require an extra attribute.


Regards,

Ângelo


Exactly! Or you could add an extra attribute in the aggregate which does this instead. Either way you won't have to change anyting in your datamodel.

hi Zainal,

I tried the same, but with correct result:

where:

1. Put single quote in front

2.


Could be:

t0:  you populate data with wrong data type

t1: you change the data type, but the data is still in there


regards,

IB 


Claring wrote:

Hey Zainal,

This is a nice example of difference between data and information.
Data is raw and unprocessed, whereas information is understandable for humans.

You want to turn this 1 into a 001, so why not do so when you are presenting the data?
It doesn't always make sense to store "information" in the database.

Or you could as others have suggested, add a new column with datatype of text, which prefills the number with 0's until a specific length has been reached.

Nice Claire,

That explanation about data vs information, but so far i have another understanding:

Information is also datum, but it has an added value - "decision-making". 

regards,

IB 


I Box wrote:

Claring wrote:

Hey Zainal,

This is a nice example of difference between data and information.
Data is raw and unprocessed, whereas information is understandable for humans.

You want to turn this 1 into a 001, so why not do so when you are presenting the data?
It doesn't always make sense to store "information" in the database.

Or you could as others have suggested, add a new column with datatype of text, which prefills the number with 0's until a specific length has been reached.

Nice Claire,

That explanation about data vs information, but so far i have another understanding:

Information is also datum, but it has an added value - "decision-making". 

regards,

IB 



Hey IB, 

Yes you are correct! The goal of information is often to help with desicion making.