Stored procedure - variabile per creazione tabella
Salve a tutti
sto creando una SP che mi crea una tabella ogni mese con il nome del mese
BEGIN
DECLARE varTable varchar(15);
SET @varTable = MONTHNAME(NOW());
CREATE TABLE varTable (
`TimeLog` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`Zona` varchar(22) NOT NULL,
`Sensore` varchar(20) NOT NULL,
`T` float NOT NULL,
`U` float NOT NULL,
KEY `TimeLog` (`TimeLog`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
END
Per come sono riuscito a scriverla, la variabile VarTable non viene valorizzata con il nome del mese. Ho provato con @ ma nulla
Grazie a tutti
Subject
Views
Written By
Posted
Stored procedure - variabile per creazione tabella
1024
November 10, 2018 01:54PM
572
November 12, 2018 06:08AM
562
November 12, 2018 08:07AM
561
November 12, 2018 08:58AM
429
November 12, 2018 10:17AM
515
November 13, 2018 05:44AM
582
November 14, 2018 04:19AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.