When using the Lookup plus component, there is a trick to get the No Match and NULL values to be output as a NULL value. This involves hitting the space bar in these fields on the grid when editing the component's properties.
My question is, if hitting the space bar causes the value to be NULL, how does one get the default value to be a space?
Is this theoretical question or you have real business scenario where the space should be used as default value?
In general it is not good idea to use space-only as default value anywhere in any system. The reason for this is many systems will do Trim of the value, before checking if it is empty. And in the case of space-only, this field will be determined to be empty.
On Thursday, September 6, 2012 4:32:22 PM UTC-4, Tim Huemmer wrote:
> When using the Lookup plus component, there is a trick to get the No Match > and NULL values to be output as a NULL value. This involves hitting the > space bar in these fields on the grid when editing the component's > properties.
> My question is, if hitting the space bar causes the value to be NULL, how > does one get the default value to be a space?
I do concur with Ivan. Having a single space in a field is most likely not
a good idea. Most systems do TRIM() fields which will turn your space into
a NULL. Furthermore, you place yourself at the risk of, when updating the
field, if you do not account for the space that is already there you will
have a space in your string and risk overflowing the field (think phone
numbers that are an NVARCHAR(10)).
With all due respect, I can think of no reasons you would want to do this
and plenty where you would not.
James
From: cozyroc@googlegroups.com [mailto:cozyroc@googlegroups.com] On Behalf
Of Ivan Peev
Sent: Friday, September 07, 2012 6:47 PM
To: cozyroc@googlegroups.com
Subject: Re: Lookup Plus - Default value as a single space
Hi Tim,
Is this theoretical question or you have real business scenario where the
space should be used as default value?
In general it is not good idea to use space-only as default value anywhere
in any system. The reason for this is many systems will do Trim of the
value, before checking if it is empty. And in the case of space-only, this
field will be determined to be empty.
Regards,
Ivan
On Thursday, September 6, 2012 4:32:22 PM UTC-4, Tim Huemmer wrote:
When using the Lookup plus component, there is a trick to get the No Match
and NULL values to be output as a NULL value. This involves hitting the
space bar in these fields on the grid when editing the component's
properties.
My question is, if hitting the space bar causes the value to be NULL, how
does one get the default value to be a space?
Thanks in advance!
Tim
-- You received this message because you are subscribed to the Google Groups
"COZYROC" group.
To post to this group, send email to cozyroc@googlegroups.com.
To unsubscribe from this group, send email to
cozyroc+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msg/cozyroc/-/9gDQSmGv05gJ.
For more options, visit https://groups.google.com/groups/opt_out.
I have a business case where this is necessary. I am dealing with a mainframe system that will not accept NULL values in a field. If there is no value for the field, then it is expecting a space.
While I agree in theory that this is not ideal, it is what it is when you are dealing with legacy systems so I'd like to know if there is a way to do this. As a workaround, I used a derived column to replace the NULL value with a space, but there are several fields in the destination table that behave like this and was hoping to save a few steps.
On Friday, September 7, 2012 6:46:57 PM UTC-4, Ivan Peev wrote: > Hi Tim,
> Is this theoretical question or you have real business scenario where the > space should be used as default value?
> In general it is not good idea to use space-only as default value anywhere > in any system. The reason for this is many systems will do Trim of the > value, before checking if it is empty. And in the case of space-only, this > field will be determined to be empty.
> Regards, > Ivan
> On Thursday, September 6, 2012 4:32:22 PM UTC-4, Tim Huemmer wrote:
>> When using the Lookup plus component, there is a trick to get the No >> Match and NULL values to be output as a NULL value. This involves hitting >> the space bar in these fields on the grid when editing the component's >> properties.
>> My question is, if hitting the space bar causes the value to be NULL, how >> does one get the default value to be a space?
Thank you for your feedback! I would say your legacy system is the exception to the rule. Your approach with the derived column sounds like a reasonable solution for the issue at hand. I cannot think of a simpler solution at this time short of changing the Lookup Plus component.
On Saturday, September 8, 2012 12:57:04 AM UTC-4, Tim Huemmer wrote:
> Ivan,
> I have a business case where this is necessary. I am dealing with a > mainframe system that will not accept NULL values in a field. If there is > no value for the field, then it is expecting a space.
> While I agree in theory that this is not ideal, it is what it is when you > are dealing with legacy systems so I'd like to know if there is a way to do > this. As a workaround, I used a derived column to replace the NULL value > with a space, but there are several fields in the destination table that > behave like this and was hoping to save a few steps.
> Tim
> On Friday, September 7, 2012 6:46:57 PM UTC-4, Ivan Peev wrote:
>> Hi Tim,
>> Is this theoretical question or you have real business scenario where the >> space should be used as default value?
>> In general it is not good idea to use space-only as default value >> anywhere in any system. The reason for this is many systems will do Trim of >> the value, before checking if it is empty. And in the case of space-only, >> this field will be determined to be empty.
>> Regards, >> Ivan
>> On Thursday, September 6, 2012 4:32:22 PM UTC-4, Tim Huemmer wrote:
>>> When using the Lookup plus component, there is a trick to get the No >>> Match and NULL values to be output as a NULL value. This involves hitting >>> the space bar in these fields on the grid when editing the component's >>> properties.
>>> My question is, if hitting the space bar causes the value to be NULL, >>> how does one get the default value to be a space?