日期:2014-05-18 浏览次数:20931 次
DECLARE @A int SET @A =0 SELECT @A=COUNT(*) FROM INFORMATION
------解决方案--------------------
CREATE PROCEDURE CREATE_grp_sample
(in TableName varchar)
这边应该也错吧,那个TableName好像前面要加@号吧
------解决方案--------------------
CREATE PROCEDURE CREATE_grp_sample (in @TableName char)
在char(指定下大小) 看这样行不
------解决方案--------------------
CREATE PROCEDURE CREATE_grp_sample
--(in TableName varchar)
@TableName varchar
as
BEGIN
DECLARE @A int
SET @A =0;
SELECT @A=COUNT(*) FROM INFORMATION_SCHEMA.TABLES where table_Name=@TableName;
if @A > 0
drop table title;
--end if;
--declare @txt varchar(500)
else
CREATE TABLE tableName (
'No' int(11) NOT NULL auto_increment,
'Time' timestamp NOT NULL default CURRENT_TIMESTAMP,
'RunTime' int(11) NOT NULL default '0',
'TempPV' float NOT NULL default '0',
'TempSV' float NOT NULL default '0',
'StressPV' float NOT NULL default '0',
'StressSV' float NOT NULL default '0',
'DTemp' float NOT NULL default '0',
'DStress' float NOT NULL default '0',
PRIMARY KEY ('NO')
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
END
------解决方案--------------------
CREATE PROCEDURE CREATE_grp_sample
(in TableName varchar)
AS...
BEGIN
DECLARE A INTEGER(12);
SET A =0;
SELECT A=COUNT(*) FROM INFORMATION_SCHEMA.TABLES where table_Name=tableName;
if A > 0
then
drop table grp_sample;
end if;
declare txt varchar(500);
CREATE TABLE tableName (
`NO` int(11) NOT NULL auto_increment,
`Time` timestamp NOT NULL default CURRENT_TIMESTAMP,
`RunTime` int(11) NOT NULL default '0',
`TempPV` float NOT NULL default '0',
`TempSV` float NOT NULL default '0',
`StressPV` float NOT NULL default '0',