Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem: Works in Analyizer, but not as stored procedure
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Problem: Works in Analyizer, but not as stored procedure
Miscellaneous
Thread ID:
00727631
Message ID:
00727631
Views:
42
I am working a query that works in the sql Query Analyizer, but when I paste it into a stored procedure, and try to call it from VFP, I get an error message saying:
---------------------------
CTORE
---------------------------
SQL ERROR: 
Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or function prt_InterOp has too many arguments specified.
 CF: 
---------------------------
OK   
---------------------------
Here is my vfp code calling it.

SQLEXEC(gnConnHandle,[exec prt_interOp ?gnMeetID,"CurDetails"])


The stored procedure saves ok, and if I do the check syntex it returns ok. Here is the code from the stored procedure, it is the same as the Query Analyizer, with the exception that in the Query Analyizer, I declare @gnMeetID and set it to a value.
CREATE PROCEDURE prt_InterOp
@gnMeetID int

as

SELECT  dbo.co_lu_Ident.idtype as rptLabel, 
	ISNULL(dbo.co_pat_ID.answerflag,0) as answerflag, 
               ' ' as otherdesc, 
              'A1' as RptGroup
FROM dbo.co_lu_Ident LEFT OUTER JOIN 
     dbo.co_Pat_ID ON dbo.co_lu_Ident.recordid = dbo.co_pat_ID.RecordID 
     and co_Pat_ID.meetingnumber=@gnMeetID 
union ALL 
SELECT dbo.co_lu_ver.verType as rptLabel, 
	ISNULL(dbo.co_pat_ver.answerflag,0) as answerflag, 
        ' ' as otherdesc, 
        'A2' as RptGroup
FROM dbo.co_lu_ver LEFT OUTER JOIN 
	dbo.co_Pat_ver ON dbo.co_lu_ver.recordid = dbo.co_pat_ver.RecordID 
	and co_Pat_ver.meetingnumber=@gnMeetID 
union ALL 
SELECT  dbo.co_lu_Cognitive.Cognitivetype as RptLabel, 
	ISNULL(dbo.co_pat_Cog.answerflag,0) as answerflag, 
               ' ' as otherdesc, 
              'A3' as RptGroup
FROM dbo.co_lu_Cognitive LEFT OUTER JOIN 
	dbo.co_Pat_Cog ON dbo.co_lu_Cognitive.recordid = dbo.co_pat_Cog.RecordID 
	and co_Pat_Cog.meetingnumber=@gnMeetID 

order by rptgroup
GO
Next
Reply
Map
View

Click here to load this message in the networking platform