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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedures in Command Objects 1

Status
Not open for further replies.

crystal28

Programmer
Oct 23, 2002
108
0
0
US
If i want to create a report using Stored Procedures in Command objects,how do i do that
I mean how should the stored procedure look like?Should it have a temp table returning the data or a cursor or how.Please explain how should the stored procedure look like.
 
In File OPtions - Database - Data Explorer you just need to check the Stored Procedures box and you can connect directly to an SP. No need to go via Commands.

Ian
 
Within DataBase Expert, choose the database
Choose 'Add Command'. Open the worksheet
Paste the code from 'Query'. This includes comments etc.
The command can also be edited.

If you can run SQL on your machine, or have access to a machine that can, you could also do your own simplified version that gives just the data you want.

Select what you need, maybe via a series of temporary tables. Best to have a conditional 'drop' at the start, e.g.
Code:
If Object_ID('tempdb.dbo.#FEE_A') Is Not Null
	Drop Table #FEE_A

At the end display it, something like
Code:
Select		*		from #FEE_ACCMONTHS
		order by	CustNo, RollNo, Asmonth, RetCount

Once added, the fields are just like any other table.

All of this is for Crystal 10. It was different in Crystal 8.5 and it's always best to give your version.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thanks Madawc,i wanted to know to have a sample code for a Stored Procedure where a Temporary Table is created in the Stored Procedure as a Return Value,so when i click on the Stored Procedure instead of clicking on Command Objects.
 
Sorry, I don't follow what you are asking. Please explain again.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top