problem with dataset calling stored procedure

preetiGu
edited February 11, 2022 in Analytics #1
Hello,

I have a report in which I have 2 datasets d1, d2.
Report execution is like this:-
d1 query selects a column from table and retuns a1, a2, a3,a4 as value.

d2 calls a stored procedure which inserts data in table "temp." using parameter value as a1, a2, a3, a4.

So I created a table assciated with d1 dataset. Added a detail row having table associated with d2 dataset. In table parameter binding changed parameter value to a1,a2,a3,a4. Like we do in sub report.

When I see data in temp table it's coming like this:-

I see 4 records inserted with a1.
3 records inserted with a2.
2 records inserted with a3.
1 record inserted with a4.

why is birt executing stored procedure 4 times for first record? Is there anything wrong with sub report design.

I was guessing that stored procedure will be called only once using a1, a2, a3, a4 seperately.

Any pointers will be greatly appreciated.

Thanks in advance.
Preeti

Comments

  • cypherdj
    edited December 31, 1969 #2
    Without looking at your code, it's difficult to say, but how do you trigger your stored procedure. If this is scripted on render of each row in your table, each time you render, it will generate a new entry your table, so:
    after rendering a1, it inserts a1 in temp
    after rendering a2, it also renders a1, so it inserts a1 and a2,
    ...

    Which would make sense considering the values you get your table.

    But without the code, it's difficult to figure out what your problem is,
    Regards,
    Cedric
  • preetiGu
    edited December 31, 1969 #3
    Thanks for a quick reply.

    I guess it's happening that way only.
    Am attaching my design file.

    Then how should I do it.

    Thanks again,
    Preeti
  • cypherdj
    edited December 31, 1969 #4
    No problem, I'll have a look at it later on and will post my findings,

    Regards,
    Cedric