2 Replies Latest reply: Jul 3, 2015 10:35 AM by Jjotavve RSS

    Check if a table is already loaded

    Bin Xue

      Hi,

       

          I would like to check if a table exist before dropping this table. I used this function

       

                if noOfRows('mytable')>0 then

                drop table mytable; 

                endif

       

         However, later i found that if a table has been created but contains no data. noOfRows function also return a number which is less or equals to zero. The scenario is as below:

       

      mytable:

      load *

      from mytable;

      inner join

      load * from

      anothertable;

       

      The above scenario creates mytable and makes it empty by a inner join.

       

      This causes my table not being dropped. Could anyone tell me if there is another way of checking the existence of a table?