SET @idcontatto:=CAST('**idcontatto**' AS CHAR)
;
SET @start:=CAST('**start**' AS CHAR)
;
SET @stop:=CAST('**stop**' AS CHAR)
;
DROP TEMPORARY TABLE IF EXISTS xml_turni
;
SET @notte_start:='22:00'
;
SET @notte_stop:='08:00'
;
CREATE TEMPORARY TABLE IF NOT EXISTS xml_turni (
    `id` int(10) unsigned NOT NULL,
    `idturno` int(10) unsigned DEFAULT NULL,
    `idpersona` int(10) unsigned DEFAULT NULL,
    `iddipendente` int(10) unsigned DEFAULT NULL,
    `codfisc` varchar(100) DEFAULT NULL,
    `matricola` varchar(100) DEFAULT NULL,
    `data` char(8) DEFAULT NULL,
    `ora_inizio` char(5) DEFAULT '00:00',
    `ora_fine` char(5) DEFAULT '23:59',
    `ore_teoriche` decimal(12,2) DEFAULT 0,
    `ore_notturne` decimal(12,2) DEFAULT 0,
    `ore_assenza` decimal(12,2) DEFAULT 0,
    `causale_assenza` varchar(100) DEFAULT NULL,
    
    `tipol_inizio` char(5) DEFAULT '00:00',
    `tipol_fine` char(5) DEFAULT '23:59',
    `kind` char(5) DEFAULT NULL,
    `asse_inizio` char(5) DEFAULT '00:00',
    `asse_fine` char(5) DEFAULT '23:59',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC