"Peter Ludwig" <green@abwesend.de> schrieb im Newsbeitrag
news:f1v0bi$r30$1@online.de...
>
> "Captain Paralytic" <paul_lautman@yahoo.com> schrieb im Newsbeitrag
> news:1178794415.594948.214350@u30g2000hsc.googlegr oups.com...
>> On 10 May, 09:02, "Peter Ludwig" <g...@abwesend.de> wrote:
>>> Hi,
>>>
>>> I have created a stored procedure in which I want to create a table.
>>> The procedure has some parameters, one of them I want to use for the
>>> table
>>> name.
>>> The table name should be dynamically put together like
>>> `parameter + static name`
>>>
>>> How can I do that?
>>>
>>> Yours sincerely
>>>
>>> Peter
>>
>> Clues to how to do it can be found here:
>> http://groups.google.co.uk/group/com...1d18a5b74358df
>>
>
>
> Hi,
>
> thanks for the link.
> I had just a short look, but I guess this is exactly what I've looking
> for.
>
> Peter
>
Yes, it helped me to solve my problem.
thank you very much
my little example:
set @statement = Concat("DROP TABLE IF EXISTS `", 'table', salesmanID,
"`;");
PREPARE stmt FROM @statement;
Execute stmt;
set @statement = Concat("
CREATE TABLE `", 'table', salesmanID,"` (
`pg_id` int(11) NOT NULL auto_increment,
`pg_created` datetime default NULL,
`pg_func` mediumtext,
PRIMARY KEY (`pg_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;");
PREPARE stmt FROM @statement;
Execute stmt;