Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes Passing parameter to view in DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Passing parameter to view in DB2" Watch "Passing parameter to view in DB2" New topic
Author

Passing parameter to view in DB2

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
Hi all
How one can pass the parameter to the DB2 view. I need to pass the parameter and retreive the value also.

Any pointers will do
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Views are like tables and can be accessed the same way you would access a table. Can you be more specific about what parameters you want to pass to the view?


My Blog: Down Home Country Coding with Scott Selikoff
Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
Hi scott,
Thanks for your time.

My requirement is i need to filter out the data based on the user input, and i think this cant be acheived in view, since view didn't support the parameter.

what exactly i need to do is write the stored procedure which will use the view and user input to filter out the invalid records.

Anyway thanks for your time.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31075
    
232

Originally posted by Parameswaran Thangavel:
My requirement is i need to filter out the data based on the user input, and i think this cant be acheived in view, since view didn't support the parameter.

A view supports parameters unless we are talking about different things. You create the view once to abstract away some complexity. Then you do the query as if it were a normal table.

You may want to post some code showing what you are trying to do that isn't supported. Then we could give more concrete comments.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing parameter to view in DB2