Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command object

Status
Not open for further replies.

swetham

Programmer
May 5, 2010
257
0
0
DE
Can anyone explain me how to create the command object and use it with small example?
 

Connect to a database and instead of clicking tables you want to use click the add command button. Enter in your SQL. Profit.
 
1. So the benefit is being able to reuse SQL and not have to define it over and over in each report?

2. Do you paste in the flavor of SQL for your database (such as SQL Server, Oracle, etc.) or does it use Crystal Syntax independent of database syntax?
 

I use command objects for more complex queries. The syntax is the same as the database. You can user parameters on command objects which can be very helpful.
 
I frequently use commands for speed with a very large (millions of records) database.

-LB
 
Another situation that I found using an SQL command advantageous occured when I had two tables to relate on a common field, except that the common field was numeric in one table and text in the other. (Aaargh!)

I couldn't link them in the normal manner, but CR was more tolerant when I used an SQL command to make the join. (I did not even have to convert one field tonum to make the connection.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top