don't select Table in trong Oracle

by Đồng Nguyễn văn   Last Updated August 14, 2019 05:01 AM

1, i check table in database if exist then delete table 2, create Table 3. select and into table new crate . but i select it error . if i comment line seledct then don't error . tks bro

DECLARE DATA_COUNT NUMBER; query varchar (500); BEGIN SELECT COUNT() INTO DATA_COUNT FROM ALL_TABLES WHERE TABLE_NAME='DELETE_LIST'; IF (DATA_COUNT > 0) THEN EXECUTE IMMEDIATE 'DROP TABLE DELETE_LIST'; ELSE DATA_COUNT:=1; END IF; query:='CREATE TABLE DELETE_LIST(ID_ INT NOT NULL)'; EXECUTE IMMEDIATE query; --SELECT COUNT() INTO DATA_COUNT FROM DELETE_LIST; -- (line error) SELECT COUNT(*) INTO DATA_COUNT FROM ALL_TABLES WHERE TABLE_NAME='DELETE_LIST'; IF (DATA_COUNT > 0) THEN EXECUTE IMMEDIATE 'DROP TABLE DELETE_LIST'; END IF; END ;



Related Questions


Updated March 24, 2017 09:01 AM

Updated April 22, 2018 10:01 AM

Updated July 04, 2019 09:01 AM

Updated March 26, 2019 19:01 PM

Updated April 20, 2019 08:01 AM