Operation Manual
Understanding Databases
Using SQL and SQL databases
25
Crystal Reports User’s Guide 513
network. SQL client software usually consists of, at the very least, an SQL
statement editor that you can use to write and execute SQL statements, and
an underlying communications layer that works with the SQL server
application over the network.
When you execute an SQL statement, the client software passes the statement
to the communications layer, which sends the statement over the network to the
server software. The SQL server analyzes the statement, performs the
requested operation, and returns any data requested to the client software. If
the server returns any data, the client software displays the data to the user.
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.