Home » Developer & Programmer » Reports & Discoverer » Report not reading the parameters passed
Report not reading the parameters passed [message #516087] Fri, 15 July 2011 01:12 Go to next message
dhivyaenjoy
Messages: 49
Registered: June 2011
Member
Hi,

I have developed a RDF report which when linked to my application called OTM, it returns data which are not expected.

My report has two lexical parameters which are of date variables.

When i run the report from my application it asks for the parameter valeus and when i specify it, the report is not returnign the data within the date range i specified. it returns me all the data.


Kindly help me out.

Regards,
Dhivya
Re: Report not reading the parameters passed [message #516113 is a reply to message #516087] Fri, 15 July 2011 02:31 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Too few information; how does your query look like? Where do you prepare those lexical parameters and how? What values do you provide? What format do you use? Etc. etc.
Re: Report not reading the parameters passed [message #516142 is a reply to message #516113] Fri, 15 July 2011 03:58 Go to previous messageGo to next message
dhivyaenjoy
Messages: 49
Registered: June 2011
Member
The query has two lexical paramters like '&p_tarrif_date' and &p_insert_date'.

These are all two date fields in a table.

sample of the query:

select
----
from
ship s,
app p
where
s.gid=p.gid and
&p_tariff_date and
&p_insert_date

The SET_LEXICAL_PARAMTER and AFTERPFORM looks as below


AFTERPFORM

function AfterPForm return boolean is
begin
set_lexical_parameters;
return (TRUE);
END;

SET_LEXICAL_PARAMETERS

PROCEDURE set_lexical_parameters IS
--pls_orig_p1 VARCHAR2(32766) ;
BEGIN

IF NOT( :P_INSERT_DATE IS NULL or :P_INSERT_DATE = '1=1') then
:P_INSERT_DATE1 := 'S.INSERT_DATE'||get_filter_condition( :P_INSERT_DATE, :p_date_format );
ELSE
:P_INSERT_DATE1 := '2=2' ;
END IF ;

IF NOT( :P_TARIFF_DATE IS NULL or :P_TARIFF_DATE = '1=1') then
:P_TARIFF_DATE1 := 'p.tariff_date'||get_filter_condition( :P_TARIFF_DATE, :p_date_format );
ELSE
:P_TARIFF_DATE1 := '2=2' ;
END IF ;

END;


We pass the two lexical paramerts in the value of 'DD-MM-YYYY'
but the two parameters are defined in the user parameters as character,2000

The issue is no matter what date i specify the data returned from the report is not matching teh dates am specifying.

Hope this helps.

Regards,
Dhivya
Re: Report not reading the parameters passed [message #516150 is a reply to message #516142] Fri, 15 July 2011 04:12 Go to previous message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
When working with dates (and passing string values), one needs to take care about correct datatype conversion (TO_DATE against strings), correct format masks etc. You use GET_FILTER_CONDITION (a function, I suppose) that accepts :P_DATE_FORMAT (which is another parameter, I guess, containing format mask you use (DD-MM-YYYY, right?). Does that function works OK?

Try to display lexical parameters with SRW.MESSAGE built-in, so that you'd see how they look like. Copy/paste them into SQL*Plus and run SELECT statement (you know how it looks like - now append lexical parameters you saw on the screen).
Previous Topic: How To Convert Data from Reports 6i to oracle Table
Next Topic: Report returns intermittent data
Goto Forum:
  


Current Time: Tue Apr 23 12:19:16 CDT 2024