From: Martijn Tonies Date: August 25 2004 3:50pm Subject: Re: Create procedure problem List-Archive: http://lists.mysql.com/mysql/171524 Message-Id: <03e901c48abb$473c5430$0a02a8c0@martijn> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi Joe, > I want to create a stored procedure that I pass a date variable and two > database names. I can not seem to figure the correct syntax to utilize > these variables in the procedure. I think I might need to build a > sqlstring and use an exec command to execute the string. Here is my > procedure code: > > # requires a table of paths called paths; > > create procedure calclmp(in startdate date, in db1 varchar(32), in db2 > varchar(32) ); > begin > drop table if exists DB1.lmp_daily, DB1.t6, DB1.tmp_month_hr; > create table DB1.lmp_daily like DB2.pjm_lmp_daily; Unless you have a database named "DB1", I think the above will fail - as far as I know, you cannot use variables/parameters like that. With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server. Upscene Productions http://www.upscene.com