Stored procedures, How does crystal reports use sql – HP Intelligent Management Center Standard Software Platform User Manual
Page 700
Stored procedures
In addition to the common relational database attributes (tables, fields,
records, and so on) many SQL DBMS systems support stored procedures.
A stored procedure is a compiled SQL program consisting of one or more
SQL statements. A stored procedure can be used to define an SQL query
that you can use over and over again. Furthermore, variables, conditional
expressions, and variable arguments can be defined in the stored procedure
so that you are prompted to provide information before the procedure is
executed.
Since stored procedures can return a result set, they can provide a specific
set of data when executed. In fact, Crystal Reports allows you to execute a
stored procedure on an SQL database and use the returned data to design
a report. If the stored procedure is designed to prompt a user for information
to base its query on, Crystal Reports will prompt you for that information
when you select the stored procedure for your report.
How does Crystal Reports use SQL?
When you connect to an SQL database, Crystal Reports acts as an SQL
client application, connecting to your SQL server through your network.
When you design a report that accesses SQL data, Crystal Reports builds
an SQL query. This query can be seen by choosing Show SQL Query from
the Database menu.
This SQL query is a representation of the SQL statement that Crystal Reports
sends to the SQL server. By interpreting as much as possible from the report
design into an SQL query, Crystal Reports can off-load much of the report
processing onto the server machine. Rather than having to sift through an
entire database to find the data you requested, Crystal Reports lets the server
700
Crystal Reports 2008 SP3 User's Guide
Understanding Databases
25
Using SQL and SQL databases