Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


stored procedure with optional where parameters using -'sql,mysql,sql-server,oracle'


stored procedure with optional where parameters  using -'sql,mysql,sql-server,oracle'

I have a form where users can specify various parameters to dig through some data (status, date etc.).

I can produce a query that is:

SELECT * FROM table WHERE:
status_id = 3
date = <some date>
other_parameter = <value>


etc. Each WHERE is optional (I can select all the rows with status = 3, or all the rows with date = 10/10/1980, or all the rows with status = 3 AND date = 10/10/1980 etc.).

Given a large number of parameters, all optional, what is the best way to make up a dynamic stored procedure?

I'm working on various DB, such as:
MySQL, Oracle and SQLServer.
    

asked Sep 7, 2015 by rajesh
0 votes
19 views



Related Hot Questions



Walkin Jobs Opening



Government Jobs Opening


...