0

I am using the below function to drop a table and create it. After I execute the function, the table is not created. Can someone please help me?

CREATE OR REPLACE FUNCTION dropAggTables111(tablename TEXT) RETURNS INTEGER AS $total$
DECLARE
total integer;   

BEGIN
 execute 'DROP TABLE IF EXISTS CURR_ACT_IN_EXP_TMP ' into total;     
 execute 'CREATE TABLE IF NOT EXISTS CURR_ACT_IN_EXP_TMP (ACTIVITY VARCHAR(32)) ' into total;

RETURN total;
END;
 $total$ LANGUAGE plpgsql;
Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
v bhosale
  • 63
  • 1
  • 1
  • 5

1 Answers1

1

Remove the INTO total. These statements don't return a result set.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263