|
|
|
Должна ли удалиться временная таблица 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&gotonew=1&tid=1831826]: |
0ms |
get settings: |
5ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
154ms |
get topic data: |
9ms |
get first new msg: |
5ms |
get forum data: |
2ms |
get page messages: |
34ms |
get tp. blocked users: |
1ms |
| others: | 245ms |
| total: | 470ms |

| 0 / 0 |
