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

can't add stored procedure to my report 1

Status
Not open for further replies.

stanja

MIS
Sep 10, 2001
149
BE
Hello ,

i've a stored procedure which works fine under sql query analyzer.
When i try to add the stored proc. to my report it doesn't give any (error) msg but it isn't added.
The file sqlsvr.err has also no msgs.
I can link views and tables without a problem.
Below is the content of the view

CREATE PROCEDURE omzet AS drop table tempomzet
SELECT
Contacts."Omschrijving", Contacts."Achternaam", Contacts."Voornaam", Contacts."Geslacht", Contacts."Taal", Contacts."Email1", Contacts."Blocked",
K1."K1KEY", K1."KODEKLANT",
V1."V1NAAM", V1."Telefoon1",
omzet2004."omzet200412",
omzet2000."omzet200012",
omzet2001."omzet200112",
omzet2002."omzet200212",
omzet2003."omzet200312"
into tempomzet
FROM
K1 join omzet2004 on K1.K1KEY=omzet2004.Klantnr join omzet2003 on K1.K1KEY=omzet2003.Klantnr join omzet2002 on K1.K1KEY=omzet2002.Klantnr join omzet2001 on K1.K1KEY=omzet2001.Klantnr join omzet2000 on K1.K1KEY=omzet2000.Klantnr join contacts on K1.K1KEY=contacts.K1Key join V1 on K1.vertegenw=V1.V1Key
WHERE
Contacts."Blocked" = 0 AND
K1."KODEKLANT" <> '900' AND
omzet2004."omzet200412" <= 0 AND
Contacts."Taal" = '1' AND
Contacts."Email1" NOT LIKE 'info%'
GO

 
In order for you to be able to add a proc as the data source for a report, the procedure must return a result set of some kind (the last statement should be a SELECT statement). Your procedure just drops and recreates a table.

If this is your intention, you need to add a simple SELECT statement at the end of the procedure, something like:

SELECT Result = 1

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top