tags:

views:

52

answers:

2

Hi there,

I know that is it possible to create a View with Parameters at MSSQL, does anyone knows if I can achieve something similar with a DB2 database?

I have a more complicated query which includes a user number which I want to pass as param to the view.

A: 

That's a stored procedure. Views have no parameters as far as I'm informed.

Alexander
+1  A: 

SQL Server supports table-valued functions. If a table-valued function is "inline" (i.e. a single statement and not a multi-statement TVF with a BEGIN END), then it effectively acts as a parameterized view and can be optimized similarly to views.

DB2 supports a table-valued function feature with very similar capabilities CREATE FUNCTION RETURNS TABLE.

Cade Roux