Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Pl/SQL, Stored Procedures Post Reply Post New Topic
Author Message
lolly54
Groupie
Groupie
Avatar

Joined: 25 Sep 2011
Online Status: Offline
Posts: 58
Quote lolly54 Replybullet Topic: Pl/SQL, Stored Procedures
     Posted: 06 Aug 2013 at 12:24pm
Hi All,

I have a question regarding Pl/SQL, Stored Procedures in Crystal Reports. I am not sure why PL/SQL or Stored Procedure shall be used when I can write the Crystal formula easily. What is the advantage of using Pl/SQL?

In my previous company, we have been using formula only and I have not come across any situation that PL/SQL should be used.

What's the difference between the two? Can anyone give me some ideas?

Thanks all!!!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Aug 2013 at 3:40am
are you asking why one would use a store procedure as a data source rather than just using tables linked and flitered through the select expert in Crystal? Or are you referencing the SQL expression option in crystal?
IP IP Logged
praveeng
Senior Member
Senior Member
Avatar

Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
Quote praveeng Replybullet Posted: 07 Aug 2013 at 3:43am
Hi,
 
As per my Knowledge, if we are using PL/SQL or Stored Procedures to create Crystal report,
It will filter the data at backend and fetch only the required results to the crystal reports and Stored Procedures are pre-executed queries so that it will fetch the required results to the designer.
For example if you creating a report on SQL database it will fetch all the records to the Crystal and then it will apply the conditions to show the required output.
if we have millions of records in data base it will fetch all the data then it will apply conditions so it will take more time to execute the report.
if we apply condition at database level or if we are using SP then it will send the required data to the designer. In this case report will excecute faster.
HTH
 
--Praveen G
Praveen Guntuka,
praveen_guntuka@yahoo.com
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Aug 2013 at 4:13am

IMO -

In general I agree with praveeng.
However it is my understanding that (depending on some of your crystal settings)  crystal,in general, will try to push the record selection down to the server so efficiency gains can be moot (e.g. using the sql expressions can facilitate server side processing).
The more sophisticated the report and the less straightforward the use of the data, the more likely you will get gains from using a sp.
Many times using a sp can keep you from using sub-reports which can often really negatively impact your report performance. 
Many people like to do all of the report calculations in the sp rather than in the crystal report. Sometimes the report requires summarizations of summarized data which can be done more readily in the sp. In these cases, using the sp, you can just place the summarized sp fields into the report rather than using print time variable formulas inside the report.


Edited by DBlank - 07 Aug 2013 at 4:15am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 07 Aug 2013 at 4:54am
And when you do the calculations in the database, it's generally faster than doing them in the report....
 
I have used an Oracle Package to provide data for a report.  For this particular report there was complex SQL that had different filters based on which of the 7  optional parameters had values.  Accounting for all of the options in a single command made the report slow - 2 to 15 minutes.  After I created the package, which runs different queries based on which parameters have values, it comes back on 15-30 seconds.  So, in this case, there was a tremendous performance increase when passing all of the processing off to the database.
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum