Board index » delphi » table / view name as a variable to a stored procedure

table / view name as a variable to a stored procedure

Hi,
Is it possible to pass a table or view name as a variable to a stored procedure and use it in the From clause?
eg
When I try to create the stroed procedure below .. I recieve the error token unknown :
I have tried other syntax combinations with no succes..
Any help is greatly appreciated..
Thanks
Michael

CREATE PROCEDURE MyProcedure (vwName varchar(30))  
AS
BEGIN
  Insert Into
    ATable (A,B,C,D)
  Select
    A, B, C, Sum(D)
  From
     :vwName  
  Group By
    A,B,C;
END

 

Re:table / view name as a variable to a stored procedure


"Michael Maidens" <mmaid...@bigpond.com> schrieb im Newsbeitrag
news:3b2daac1$1_1@dnews...
Quote
> Is it possible to pass a table or view name as a variable to a stored

procedure and use it in the From clause?

No.
--

Regards,
Tilo Muetze

Other Threads