|
|
|
Должна ли удалиться временная таблица tmp1?
|
|||
|---|---|---|---|
|
#18+
В цикле произвожу действия со временными таблицами в динамических запросах. При выполнении запроса выдает, что табл. tmp1 уже существует. set i_=0; while dd_<=d2_ do set i_=i_+1; set @sql=concat("drop table if exists tmp",cast(i_ as char(3)),";"); prepare getCountrySql from @sql; execute getCountrySql; deallocate prepare getCountrySql; set @sql=concat("create temporary table tmp", cast(i_ as char(1)), " as select rf_departmentid, count(*) as n from tmpTap as t where resultdate='",cast(dd_ as char(12)),"' group by rf_departmentid;"); prepare getCountrySql from @sql; execute getCountrySql; deallocate prepare getCountrySql; end while; Может, в динамических запросах временные таблицы имеют отдельную область действия или что-то вроде этого? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.05.2016, 17:48 |
|
||
|
|

start [/forum/topic.php?fid=47&fpage=102&tid=1831826]: |
0ms |
get settings: |
12ms |
get forum list: |
20ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
26ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
52ms |
get tp. blocked users: |
2ms |
| others: | 243ms |
| total: | 377ms |

| 0 / 0 |
