Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Parameter within Stored Procedure
birtprofi
<p>Hi guys,</p><p> </p><p>I need your help with a date Parameter in a Stored Procedure</p><p> </p><p>Following SQL Works within MSSQL and Firebird:</p><p> </p><p>SELECT *<br />
FROM specificProcedure ([color=#0000cd;]'String as where clause'[/color]) p</p><pre class="_prettyXprint _lang-sql">SELECT *FROM specificProcedure (' where TYPE = 0 and DDATE between ''2014-05-01 00:00'' and ''2014-05-31 23:59'' ) ') p</pre><p>Instead of ' '2014-05-01' ' I would like to use ? as Parameter. But I always get a failure.</p><p>I think it is because the use of ' '. So the Report don´t parse ? as Date but as figure.</p><p> </p><p>If I look into the log file it parse like .... and DDATE between ? and ? and not DDATE between '2014-05-01'</p><p>So I guess, I have to call the parameter in another way.</p><p> </p><p>Please give me your advice.</p><p> </p><p>best regards</p><p>rf</p><p> </p>
Find more posts tagged with
Comments
kclark
<p>Instead of using ? in the query you could change the query in beforeOpen() of your data set. Then you could reference you parameter from there. Doing something like this (untested)</p><p> </p><p></p><pre class="_prettyXprint _linenums:0"> this.queryText = "SELECT * FROM specificProcedure ('" + param["paramName"].value + ")....</pre>
birtprofi
<p>Hi Clark,</p>
<p> </p>
<p>you are on the right way. I put the SQL into Propety Binding and change the String to ' ' " + ...</p>
<p>and now it works.</p>
<pre class="_prettyXprint _lang-sql">
this.queryText = "SELECT * FROM specificProcedure ('' " + param["paramName"].value + " '')....
</pre>
<p>thanks a lot</p>
<p>rafael</p>
kclark
<p>No problem! Let us know whenever you've got questions!
</p>