문제

I try to fill my temp table but i get the following error :

SQL Error (-958) : Temp table (temp_table11) already exists in session.

CREATE TEMP TABLE temp_table11
  ( emp_num int);


SELECT emp_num FROM hrgetd INTO  temp_table11
WHERE( emp_num = v_emp_num AND calc_year = p_calc_year)
도움이 되었습니까?

해결책

You are trying to create table again in your select statement, try this

CREATE TEMP TABLE temp_table11
  ( emp_num int);

INSERT INTO temp_table11
SELECT emp_num FROM hrgetd
WHERE( emp_num = v_emp_num AND calc_year = p_calc_year)

다른 팁

When you use SELECT INTO you no need to declare your table

SELECT emp_num FROM hrgetd INTO  temp_table11
WHERE( emp_num = v_emp_num AND calc_year = p_calc_year)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top