Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
April 24, 2006, 1:31 pm
rate this thread
I need to dynamically create an SQL statement within a MySQL 5.0.20
-- PSEUDO CODE
create procedure DynSQLTest
in sTable varchar(45)
declare sSQL varchar(45);
select Concat('select * from ',sTable,' where ...) into sSQL;
Is there a possibility to construct the SQL in a varchar and then
execute it? I spent some time googling but did not find anything.
Thank you for any help!
Re: Dynamically construct and execute SQL in StoredProcedure
You can do this in stored procedures. See example in this article:
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum