MySQL Forums :: Stored Procedures :: How to Exec variable contenting SQL statement in Procedure?


Advanced Search

How to Exec variable contenting SQL statement in Procedure?
Posted by: Tuan Nguyen ()
Date: March 21, 2005 04:12AM

I have one procedure Such as:
create procedure (in Fieldname varchar(100))
begin
declate SQL varchar(200);
set SQL='select '+Fieldname+' From Table1 where CodeID=0001';
Exec SQL;
'here i want to exec SQL variable SQL the same SQL server, but i can not
end
-I need so much, Help me, thanks.

Options: ReplyQuote


Subject Views Written By Posted
How to Exec variable contenting SQL statement in Procedure? 10372 Tuan Nguyen 03/21/2005 04:12AM
Re: How to Exec variable contenting SQL statement in Procedure? 5190 Andrew Gilfrin 03/21/2005 07:39AM
Re: How to Exec variable contenting SQL statement in Procedure? 4405 Tuan Nguyen 03/22/2005 01:26AM
Re: How to Exec variable contenting SQL statement in Procedure? 4422 Tuan Nguyen 03/22/2005 03:16AM
Re: How to Exec variable contenting SQL statement in Procedure? 4363 Andrew Gilfrin 03/22/2005 02:50AM
Re: How to Exec variable contenting SQL statement in Procedure? 4058 Atanas Todorov 03/29/2005 12:45AM
Re: How to Exec variable contenting SQL statement in Procedure? 8600 Andrew Gilfrin 03/29/2005 01:45AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.