dharmer1975
Programmer
I'm trying to create the following procedure in MS SQL Server 7.0 I get an error "Error 170: Line 3: Incorrect syntax near '@selectview'. Line 3: Incorrect syntax near '@selectedview'. I want @selectedview to be a parameter name (for the name of a view) I want to pass to the procedure using a callable statement in Java. Is it not possible to use a variable name in this way? Here's the procedure:
CREATE PROCEDURE FERPview
@selectedview Varchar (20)
AS ( SELECT distinct((SELECT cast(sum(Number_of_Responses)as float) from harmerd.@selectedview) / (SELECT cast(count(distinct(imc_trackingnumber))as float) FROM harmerd.@selectedview)) as '# of Responses to Resolution'
from harmerd.@selectedview)
Any assistance would be greatly appreciated!
CREATE PROCEDURE FERPview
@selectedview Varchar (20)
AS ( SELECT distinct((SELECT cast(sum(Number_of_Responses)as float) from harmerd.@selectedview) / (SELECT cast(count(distinct(imc_trackingnumber))as float) FROM harmerd.@selectedview)) as '# of Responses to Resolution'
from harmerd.@selectedview)
Any assistance would be greatly appreciated!