I have an existing database....this has to be upgraded with a new set of tables in addition to the existing ones. Some of the existing tables have to be modified. I'm writing an alter for this.
There is a table STDM_T, I know when I'm running these alters this table will most likely be empty, but I have to check to make sure the table is empty and if it is, I have to drop the table and recreate it!!
This is supposed to go into 'alters'... Any help is appreciated!!
TIA
check if table is empty and then alter it
Page 1 of 12 Replies - 4389 Views - Last Post: 11 February 2008 - 12:59 PM
Replies To: check if table is empty and then alter it
#2
Re: check if table is empty and then alter it
Posted 11 February 2008 - 12:12 PM
You might want to try running a simple query to make sure it's empty - something like SELECT COUNT(*).
#3
Re: check if table is empty and then alter it
Posted 11 February 2008 - 12:59 PM
well, I have the following:
select count(*) into v_count from table
where rownum=1
if(v_count>0) then
create table
select count(*) into v_count from table
where rownum=1
if(v_count>0) then
create table
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|