Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
remo0017
Contributor II
Contributor II

Null values in where clause of Load statement

I am using a load script to load data from qvd file

But I am having issues when i am trying to select the data for the column where its value is NULL,

When I try to use the where clause with the following I am getting the required rows

where Column1 = ' ';

But when I include another condition like below I am not able to get the required results,

where Column1 = ' ' and Column2='apple' or Column2='HP'

I tried using isnull(column1) also if(isnull(column1),1,0) and if(len(column1)>1,column1,000) but none of them are giving me the actual results,

Request you folks to help me out to get through the issue

1 Solution

Accepted Solutions
tresesco
MVP
MVP

I guess it would be a logical inference issue. Try putting your 'or' conditions within braces like:

where Column1 = ' ' and ( Column2='apple' or Column2='HP') ;

View solution in original post

5 Replies
tresesco
MVP
MVP

I guess it would be a logical inference issue. Try putting your 'or' conditions within braces like:

where Column1 = ' ' and ( Column2='apple' or Column2='HP') ;

jonathandienst
Partner - Champion III
Partner - Champion III

Or you could do it like this:

  Where Len(Trim(Column1)) > 0 and WildMatch(Column2, 'apple', 'HP')

(Detect empty strings and nulls in Column1, case-insenitive compare for Column2)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
ramasaisaksoft

Step 1:-First of all without doing this where condition just check the data is available or not in that qvd so that you will also get the confirmation ,

After that you can apply the  where Condition

Step 2:-

you can check column 1 =' '(Here Null means "space bar" with in the single quotes)

else

where Len(trim(column 1))=0    and  wild match(column 2,'Apple','HP')

please close the this thread if you feel you got the solution by clicking "Correct Answer".

beck_bakytbek
Master
Master

Hi Raj,

check this: https://www.youtube.com/watch?v=l20fjOQgbRc

i hope that helps

beck

remo0017
Contributor II
Contributor II
Author

Thanks very much, this answers my question