It's not a secret anymore!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703
    
    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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

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
 
Consider Paul's rocket mass heater.
 
subject: Passing parameter to view in DB2
 
Similar Threads
Packed decimal conversion - Java
JBoss Seam question
store Procedure of Oracle, Mysql, DB2, etc??
Dynamic navigation in jsf
RowSet Problem in DB2