Question

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)
Was it helpful?

Solution

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)

OTHER TIPS

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)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top