Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding data declaration

Former Member
0 Likes
720

I am writing a report based on the number of customers.

For ex: if the number of customers are greater than 50, peform this, if the number of customers are greater than 100, perform that etc.

My question is - Should I declare 'number of customers' as integer or numeric ? What difference does it make?

Thanks in advance for your input,

Krishen

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
684

No difference really since you are not storing the value in a table. Just use integar.

The value is the same, but with a numeric, it is stored with leading zeros, with integar, it is just the value.

Regards,

Rich Heilman

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
685

No difference really since you are not storing the value in a table. Just use integar.

The value is the same, but with a numeric, it is stored with leading zeros, with integar, it is just the value.

Regards,

Rich Heilman

Read only

0 Likes
684

Thanks Rich!

If I store the value in a table, should I use numeric ? If so, why?

Regards,

Krishen

Message was edited by: Krishen

Read only

0 Likes
684

It really depends on how you plan to use this value. If it is strictly a counter type of field, either type would be ok.

Regards,

Rich Heilman

Read only

anversha_s
Active Contributor
0 Likes
684

hi kishen,

since its customer u declare it integer.

rgds

anver

mark all hlpful answers

Read only

Former Member
0 Likes
684

no difference you can use either of the way ..

Read only

Former Member
0 Likes
684

hi,

Better you declare it as integer.

If you declare it as numeric, you need to know what will be the upper limit to the no. of customers. Ofcourse, integer also has a limit.

data: v_cnt(4) type n.

it can not hold greater than 9999. So, better declare as integer instead of numeric as you dont know the no of customers.

Regards,

Sailaja.