SQL View - Use FUNCTION

In a SQL View I am trying to create a SELECT statement that utilizes a function. My very simple test code is the following:

s:=@DB2Schema(@DbName);

"CREATE FUNCTION returns_zero() RETURNS SMALLINT RETURN 0; " +

"SELECT LastName, returns_zero() AS MyNumber FROM " + s + “.CUSTOMER_V”

(this is just a test example. The actual code that I use is much more complicated)

When I try to run this I get the following error:

“The given query cannot generate a result set and therefore has not been executed”

The query should give back:

LastName MyNumber


Lastname1 0

Lastname2 0

Lastname3 0

so it will return a result set.

It looks like Domino/Notes doesn’t like a query that does not start with “SELECT”.

Anyone with any idea on how to bypass that issue? I am not trying to INSERT or UPDATE. I just want to utilize FUNCTIONs on a SELECT statement.

Thanks