List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:August 25 2004 3:50pm
Subject:Re: Create procedure problem
View as plain text  
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

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Upscene Productions

Create procedure problemJoe Byers25 Aug
  • Re: Create procedure problemMartijn Tonies25 Aug