Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Validation
Tue, Sep 20 2011 2:59 AMPermanent Link

Petter Topp

How to validate/control the the length of a value (in the where clause I can
test if the value is Null or any specified value),
but how do I verify that a given value has the minimum length?

Petter
Tue, Sep 20 2011 3:16 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Petter


On the basis of what you've posted I think you're looking for LENGTH. If that's wrong can we have some more details please.

Roy Lambert [Team Elevate]
Tue, Sep 20 2011 4:04 AMPermanent Link

Petter Topp

Hi Roy.

What I would like is:

SELECT col1, col2
WHERE (col1 = Null OR LENGTH(col1) < 5) AND (col = Null OR LENGTH(col2) < 9)

I seem to remember that you can't use functions in the where clause - so I
need an alternative

Petter



"Roy Lambert"  skrev i nyhetsmeldingen:
D893D2D8-5D06-42E9-A786-EC9156D4FE05@news.elevatesoft.com ...

Petter


On the basis of what you've posted I think you're looking for LENGTH. If
that's wrong can we have some more details please.

Roy Lambert [Team Elevate]
Tue, Sep 20 2011 5:14 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Petter


Works here with V4. Try it and see

Roy Lambert [Team Elevate]
Tue, Sep 20 2011 6:17 AMPermanent Link

Petter Topp

Sure it works - I don't know why I thought that functions in the where
clause did not work.

Must be getting old....

Thanks

"Roy Lambert"  skrev i nyhetsmeldingen:
07203233-21C8-4F94-B686-D8B10441B3CF@news.elevatesoft.com ...

Petter


Works here with V4. Try it and see

Roy Lambert [Team Elevate]
Fri, Sep 23 2011 3:34 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Petter,

<< Sure it works - I don't know why I thought that functions in the where
clause did not work. >>

You are probably thinking of my warnings about functions in the WHERE clause
not being optimized.  They work, but when used around a column for a
comparison, will cause the comparison to be un-optimized.  For example:

Assume an index on MyColumn (String field)

Optimized:

MyColumn = UPPER('Test')

Un-Optimized:

SUBSTRING(MyColumn,1,4) = UPPER('Test')

<< Must be getting old.... >>

You and everyone else on the planet. Wink

--
Tim Young
Elevate Software
www.elevatesoft.com
Image