Feature #570

Dynamic Query Capability (first step, session state only)

Added by Chris Stefanich almost 6 years ago. Updated almost 6 years ago.

Status:ResolvedStart date:10/05/2011
Priority:NormalDue date:
Assignee:Andy Dufilie% Done:

0%

Category:Internal Code Refactoring
Target version:1.0
Complexity:Medium OIC Priority:
Required by:Grand Rapids, Michigan

Description

Allow dynamic query capability by using placeholder values in the datatable query:

"SELECT ""something"",""somethingelse"" FROM ""schema"".""table""
where val1 = '{{value1}}' and val2 = '{{value2}}'"

When the query is retrieved and is going to be executed, there
is a way to pass value1 and value2 to the query where the {{value1}}
and {{value2}} placeholders would be replaced with the desired values
before the query was executed.

History

#1 Updated by Andy Dufilie almost 6 years ago

The safe way to implement this would be to use sql-supported "?" placeholders instead of building the query string ourselves:

"SELECT ""something"",""somethingelse"" FROM ""schema"".""table""
where val1 = ? and val2 = ?"

#2 Updated by Chris Stefanich almost 6 years ago

We would like to start adding our due dates to projects as requested, could we get the estimated hours for this issue? Thanks!

#3 Updated by Andy Dufilie almost 6 years ago

Something could be hacked in quickly so it could be done through the session state. A GUI would take much longer.

#4 Updated by Chris Stefanich almost 6 years ago

We would be most interested in the session state method, thanks!

#5 Updated by Andy Dufilie almost 6 years ago

  • Subject changed from Dynamic Query Capability to Dynamic Query Capability (first step, session state only)
  • Category set to Internal Code Refactoring
  • Complexity set to Medium

#6 Updated by Andy Dufilie almost 6 years ago

  • Status changed from Open to Resolved
  • Assignee set to Andy Dufilie

To use this feature, put ? placeholders in a SQL query and in the Weave column reference you can specify sqlParams in the session state. Here's an example:

server sqlQuery:
select myKey,myColumn from myTable where myColumn >= ? and myColumn <= ?

client hierarchyPath:
<attribute name="myColumn" dataTable="myTable" sqlParams="10,20"/>

#7 Updated by Chris Stefanich almost 6 years ago

Awesome! this works great, and will save us hours of work, thanks!

#8 Updated by Andy Dufilie almost 6 years ago

  • Target version set to 1.0

Also available in: Atom PDF