vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| SELECT CONCAT(title, ' is in ', book) FROM MyTable -- Jack Vamvas ___________________________________ Need an IT job? http://www.ITjobfeed.com/mysql <a href="http://www.itjobfeed.com/mysql"> mysql it jobs</a> "Peter Ludwig" <green@abwesend.de> wrote in message news:f1ujkf$bt8$1@online.de... > 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 > > > |
| |||
| On 10 May, 11:10, "Jack Vamvas" <DEL_TO_RE...@del.com> wrote: > SELECT CONCAT(title, ' is in ', book) FROM MyTable > > -- > > Jack Vamvas > ___________________________________ > Need an IT job? http://www.ITjobfeed.com/mysql > > <a href="http://www.itjobfeed.com/mysql"> mysql it jobs</a> > > "Peter Ludwig" <g...@abwesend.de> wrote in message > > news:f1ujkf$bt8$1@online.de... > > > > > 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- Hide quoted text - > > - Show quoted text - That's not exactly what he asked is it? |
| |||
| 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 |
| |||
| "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 |
| |||
| On 10 May, 12:40, "Peter Ludwig" <g...@abwesend.de> wrote: > "Captain Paralytic" <paul_laut...@yahoo.com> schrieb im Newsbeitragnews:1178794415.594948.214350@u30g2000h sc.googlegroups.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...rowse_frm/thre... > > Hi, > > thanks for the link. > I had just a short look, but I guess this is exactly what I've looking for. > > Peter- Hide quoted text - > > - Show quoted text - Shucks! I can't take all the credit, I just googled this group! |
| ||||
| "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; |