Lookup Plus - Default value as a single space

97 views
Skip to first unread message

Tim Huemmer

unread,
Sep 6, 2012, 4:32:22 PM9/6/12
to coz...@googlegroups.com
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

Ivan Peev

unread,
Sep 7, 2012, 6:46:57 PM9/7/12
to coz...@googlegroups.com
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

James Summerlin

unread,
Sep 7, 2012, 8:26:04 PM9/7/12
to coz...@googlegroups.com

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

--
You received this message because you are subscribed to the Google Groups "COZYROC" group.
To post to this group, send email to coz...@googlegroups.com.
To unsubscribe from this group, send email to cozyroc+u...@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.
 
 

Tim Huemmer

unread,
Sep 8, 2012, 12:57:04 AM9/8/12
to coz...@googlegroups.com
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

Ivan Peev

unread,
Sep 9, 2012, 6:32:27 AM9/9/12
to coz...@googlegroups.com
Hi Tim,

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.

Regards,
Ivan
Reply all
Reply to author
Forward
0 new messages