Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Ignore where clauses when the value is space

$
0
0

Hi,

 

I have a SQL Select on say a table A that has columns a1 a2 and a3. I am writing a stored procedure that would return a sum of a3 for a specific a1 and a2 values.

 

So the query looks like this

 

select sum(a3) from A where a1 = :val1 and a2 = :val2 (val1 and val2 are the in parameters for my stored proc).

 

Now the issue is I want the where condition to be ignored if val1/val2 is null or space. so if val1 is space, then only the a2 = :val2 condn should be considered and vice versa.

 

 

Regards,

Anusha


Viewing all articles
Browse latest Browse all 6412

Trending Articles