Page 1 of 1

Initializing a field to spaces

PostPosted: Sun Apr 27, 2008 10:16 pm
by sdbjz01
I recently had a new field added to an existing database segment by our DBA. He told me that this field would automatically be initialize to low-values. Is there a way for the DBA to initialize this new field to 'spaces' rather then 'low-values' at the time when he makes this database changes?

Yes, I know I can write a program to intialize this new field but I was just wondering and there happens to be applications here that will not work if a field has low-values in it.

Re: Initializing a field to spaces

PostPosted: Sun Apr 27, 2008 11:27 pm
by dick scherrer
Hello sdbjz01 and welcome to the forums,

Yes, low-values is a typical initial value.

I was just wondering and there happens to be applications here that will not work if a field has low-values in it.
As this is a new field that no program currently uses (can't as it doesn't exist), the initial value shoud not be a problem.

Yes, I know I can write a program to intialize this new field
This could easily be done with a single update sql query. If you do not want (or are not permitted) to run the query in production, you might make a deal with the dba(s) that you would provide the query and jcl and they would run the update after the new field has been added.

I suspect that this is not the first new field ever added to a database and hopefuly, there are standards about how this is to be done on your system. If there are standards, i recommend following them. If there are none or if you believe they are incomplete, creating them or modifying the existing may be in order.