Application Development 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: 

Custom Table - New Field

Former Member
0 Kudos

Added SPART in a custom table , I am trying to retrieve an entry from that table where SPART is SPACE. This works fine in DEV, in Q system the select does not work.. What could be the reason ?

1 ACCEPTED SOLUTION

christine_evans
Active Contributor
0 Kudos

>

> Added SPART in a custom table , I am trying to retrieve an entry from that table where SPART is SPACE. This works fine in DEV, in Q system the select does not work.. What could be the reason ?

Are you sure that SPART = SPACE? I've noticed before that when you add a new character field to an existing table that already contains records, the default value for the new field on the existing records is NULL and not SPACE. Try replacing the = SPACE with IS NULL.

If this is the case, I think that if you update the record the default will then be changed from NULL to SPACE.

9 REPLIES 9

Former Member
0 Kudos

What do you mean 'does not work'? Does it dump, give an error message, a return code??

Rob

0 Kudos

The query does not return a record when there are many records with SPART = SPACE

0 Kudos

What does the data look like in SE16?

Rob

0 Kudos

Hi,

Share the Query Please....

Former Member
0 Kudos

Hi sridhar,

Chek if there is any data for SPART in your custom table in Q system...

-Goodluck,

Bhumika

christine_evans
Active Contributor
0 Kudos

>

> Added SPART in a custom table , I am trying to retrieve an entry from that table where SPART is SPACE. This works fine in DEV, in Q system the select does not work.. What could be the reason ?

Are you sure that SPART = SPACE? I've noticed before that when you add a new character field to an existing table that already contains records, the default value for the new field on the existing records is NULL and not SPACE. Try replacing the = SPACE with IS NULL.

If this is the case, I think that if you update the record the default will then be changed from NULL to SPACE.

0 Kudos

Hi Christine.. You have understood the problem perfectly... Thank you .. I have even tried with NULL, even that does not work, I mean it does not retrieve the record...Is it by any chance dependent on the database ? We are using Oracle... Just FYI... I have used the database utility and tried to adjust the table, I was hoping that would get in a space into SPART , even then no luck... Only way out that looked to me was getting the user to put a space into each of the record through SM30...

0 Kudos

It won't work if you put the word NULL into SE16 but it will work if you put SPART IS NULL in a SQL statement in a program - I'm not sure which you are doing.

You can avoid this problem if you tick the Initial Values box when you create the field in SE11.

0 Kudos

Thank You Christine...That I guess would solve my problem...