Question: I'm using DB2 v9

I have a stored procedure with paramaters that can potentially be passed in as empty strings. Here somer pseudocode for what I'm trying to do:

```
WHERE myColumn.name =
     IF param1 = '' THEN
        **disregard this param, all column values are eligible**
     ELSE
        myColumn.name = param1;

```

Basically just ignore the param if it is an empty string. If not, apply it as a filter in the WHERE clause. Is this possible to do in DB2?

Answer: 
```
SELECT ...
FROM ...
WHERE  param1 = '' 
   OR  myColumn.name = param1
   ;

```
Another Keyword here would be "[Dynamic SQL](https://www.ibm.com/developerworks/mydeveloperworks/blogs/SQLTips4DB2LUW/entry/prepare_execute?lang=en)". Build your queries as a string and either `EXECUTE IMMEDIATE` them (for UPDATE, INSERT or DDL's) or use `PREPARE`/`OPEN`/`FETCH` (for SELECT's).