Why are you dropping the table? If you are using oracle (i recognize the pl/sql statements) you can use the statement truncate table x. That would be a smarter solution
You say that there is only a problem with insert when the table didn’t exist before your run of this procedure. That suggests that you are inserting in the old tabel. How many records are in the table ?
Furthermore you don’t give a complete source of your procedure so we don’t know what exactly is happening.
And as a last note don’t use goto.
Goto leads to ugly code and here it isn’t even necessary.
And in your sample the create will always be executed.
then drop end if;
is the same