Report generating wrong data in Windows7 [message #553654] |
Mon, 07 May 2012 10:44 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
Hi!
I am actually having problems with a report that is generating wrong data in Windows 7 only. I have the same report working correctly on many Windows XP Computers.
May I have some suggestion on what's going on?
|
|
|
|
Re: Report generating wrong data in Windows7 [message #553663 is a reply to message #553657] |
Mon, 07 May 2012 13:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
This report has 2 inputs the account number and a range of dates the first one is a character and the others are date types. It was made in Reports 6i. I am running this report using the Report Builder.
This report shows the total amount of money for the account number which is returned by a stored procedure in the database. This value is set to a number type user parameter which I use as source for the object in the body of the report.
But in Windows 7 the report shows this total as zero. Executing the procedure directly in the database the value is totally different.
[Updated on: Mon, 07 May 2012 13:14] Report message to a moderator
|
|
|
|
Re: Report generating wrong data in Windows7 [message #553681 is a reply to message #553675] |
Mon, 07 May 2012 16:17 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
I tried what you asked and nothing really changed I have a When Others and a No Data Found in the store procedure, commented both and the same kept happening. Also I have one when others right after the call of the procedure in the report but doing the same its still showing zero.
|
|
|
Re: Report generating wrong data in Windows7 [message #553691 is a reply to message #553681] |
Tue, 08 May 2012 00:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Create a table:create table test
(param_1 varchar2(30), -- or, even better, datatype of a "real" first parameter of your stored procedure
param_2 varchar2(20) -- - " - - " - seconde - " -
); (include more parameters if your procedure accepts it). Then create a procedure:
create or replace procedure prc_log (par_1 in varchar2, par_2 in varchar2)
is
pragma autonomous_transaction;
begin
insert into test (param_1, param_2) values (par_1, par_2);
commit;
end;
Now include call of the newly created procedure at the beginning of your stored procedure:create or replace procedure your_proc (par_1 in <datatype>, par_2 in <datatype>, ...) is
begin
prc_test (par_1, par_2); -- include datatype conversion (TO_CHAR), if necessary
<the rest of your code>
end;
Run the report. The PRC_TEST will insert parameters' values into the TEST table. Go to SQL*Plus and check what's being passed to the stored procedure. Does it reveal anything new / strange?
|
|
|
Re: Report generating wrong data in Windows7 [message #553847 is a reply to message #553691] |
Tue, 08 May 2012 17:41 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
I did the test with the debug table and its inserting some weird values for example im entering the dates from 01-11-2011 to 30-11-2011 (DD-MM-YYYY) it's inserting the month always as 10 instead of 11 and the year is inserting as a random value (first test inserted year 100, second test was year 4700). Im actually checking the report to find where this value is changing.
|
|
|
Re: Report generating wrong data in Windows7 [message #555126 is a reply to message #553847] |
Mon, 21 May 2012 09:47 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
Hi everyone!
I actually would like to check this case again since I had to change my priority. To extract the year and month from the report's date parameter I am using the next query:
SELECT TO_NUMBER (TO_CHAR (:s_date, 'YYYY')),
TO_NUMBER (TO_CHAR (ADD_MONTHS (:s_date, -1), 'MM'))
INTO s_year, s_month
FROM DUAL;
Actually this is what giving me some trouble cause before sending the year to the stored procedure I have a debug table which is showing me that the year is a ramdom number not the year that should be. Example I got year 9011,4121,0 when I was doing test with a 2011 date. The month isnt giving any problem at all.
I can't understand why this wont work in Windows7 cause it's just basic way to extract the year.
|
|
|
|
|