onigunn
onigunn

Reputation: 4778

Databases Views with Parameters

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.

Upvotes: 1

Views: 3867

Answers (2)

Cade Roux
Cade Roux

Reputation: 89671

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.

Upvotes: 3

Alex
Alex

Reputation: 14618

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

Upvotes: 1

Related Questions