Home » Developer & Programmer » Reports & Discoverer » Data inserted twice in report
Data inserted twice in report [message #455202] Mon, 10 May 2010 11:24 Go to next message
shanmugarajanbu
Messages: 18
Registered: August 2009
Location: chennaI
Junior Member

Dear all,

I have a report for this report i want to insert a data into one table. when am inserting the data then two time its inserted. if i run the report its inserted the data and i have taken the pdf file then also inserted 2 time for this any one help me.

Note: This report having only one group.
not necessary below method give any other solution
if destype=pdf then
no need to insert otherwise insert the data

Regards,
Shan
Re: Data inserted twice in report [message #455204 is a reply to message #455202] Mon, 10 May 2010 11:30 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
What code are you using to do the insert?
Where is the code run from?
Re: Data inserted twice in report [message #455242 is a reply to message #455204] Mon, 10 May 2010 15:49 Go to previous messageGo to next message
Littlefoot
Messages: 21580
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I guess that, if you ran the report once again, you'd also insert the same record(s). And again, and again - as many times as you run the report. It probably means that you designed it wrong. Perhaps you should first check whether such data already exist; if so, skip inserting.
Re: Data inserted twice in report [message #456850 is a reply to message #455242] Wed, 19 May 2010 12:07 Go to previous messageGo to next message
shanmugarajanbu
Messages: 18
Registered: August 2009
Location: chennaI
Junior Member

Dear All,
Thanks for your replay.

I have used the formula column for inserting the data( i have used INSERT statement ).
In this report having only one group so i have written the code in that group.

Regs,
Shan
Re: Data inserted twice in report [message #456927 is a reply to message #456850] Thu, 20 May 2010 03:47 Go to previous messageGo to next message
cookiemonster
Messages: 13894
Registered: September 2008
Location: Rainy Manchester
Senior Member
Why not use the before report trigger?
Re: Data inserted twice in report [message #457005 is a reply to message #456927] Thu, 20 May 2010 12:06 Go to previous messageGo to next message
shanmugarajanbu
Messages: 18
Registered: August 2009
Location: chennaI
Junior Member

Dear,

I have used the after report trigger and before report trigger also but i have faced same problem .

Regs,
Shan
Re: Data inserted twice in report [message #457010 is a reply to message #457005] Thu, 20 May 2010 13:23 Go to previous messageGo to next message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
1) We don`t know what kind of report you have.
2) We don`t know you are using those before/after trigger.
3) We don`t know What you are expecting.
4) So post the code you are using right now it will be better provide us the requirements properly to help you

sriram Smile

[Updated on: Sat, 22 May 2010 23:20]

Report message to a moderator

Re: Data inserted twice in report [message #457244 is a reply to message #457010] Sat, 22 May 2010 08:30 Go to previous messageGo to next message
shanmugarajanbu
Messages: 18
Registered: August 2009
Location: chennaI
Junior Member

Dear Sriram

please chk the attached file then u will know.

  • Attachment: tests_pdf.pdf
    (Size: 248.91KB, Downloaded 848 times)
Re: Data inserted twice in report [message #457251 is a reply to message #457244] Sat, 22 May 2010 09:27 Go to previous messageGo to next message
Littlefoot
Messages: 21580
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why cursor? You declare it, open it, fetch, close. The same could have been done in a single SELECT statement.

Why nested BEGIN-END? The same could have been done in a single BEGIN-END block.

What causes the "Message" to appear? You didn't post that code. Is it, perhaps, responsible for duplicate record?

If you don't want to insert the same value twice, include check whether it already exists into the WHERE clause (the one you used for the "rec_serial" cursor. Just don't use a cursor).

Besides, will your users REALLY run the report through Reports Builder? I don't think so.
Re: Data inserted twice in report [message #457286 is a reply to message #457251] Sun, 23 May 2010 00:57 Go to previous message
shanmugarajanbu
Messages: 18
Registered: August 2009
Location: chennaI
Junior Member

hi,

if i run the report then data inserted and i have taken the pdf file then also data inserted again. This is the my problem.

if i taken the pdf file then data should not be insert. this is my requirement.

Note :-
not necessary below method give any other solution
if destype=pdf then
no need to insert otherwise insert the data

hi, sriram am waiting for your replay.I thing you are able to find out the solution.

Regs
shan
Previous Topic: REP-52266, REP-50503
Next Topic: order in matrix report column
Goto Forum:
  


Current Time: Sat Aug 15 15:02:23 CDT 2020