当前用户吧。
drop table tbname;
create table tbname ...;pl/sql里面
begin
execute immediate 'drop table tbname';
exception when others then
   null;
end;
execute immediate 'create table tbname ...'
...

解决方案 »

  1.   

    估计这个只能在存储过程中来执行了,在sql语句不好处理的。
    我感觉你这里是把所有的表删除了,所以没有判断的必要,直接先drop再重建就可以了呀!
      

  2.   

    select count(*) into num from user_tables  where table_name=upper('tabname')
    if num=0 then
     str:='create table '||tabname||'....';
    else
    str:='drop table '||tabname;
    end if;
    execute immediate  str;
      

  3.   

    提示是我用web程序来实现的,这个不用考虑的,呵呵,
    另外:大家都说用存储过程,存储过程能在前台的web程序里面使用吗?
    如果能使用,那么怎么用呢?
      

  4.   

    java里面是可以的。
    直接调用存储过程就可以了。
     private static String getContent(String type, String startDate,
                                       String endDate) throws
          DAOException {
        DBconn db = null;
        String sql = null;
        ResultSet rs = null;
        Connection con = null;
        CallableStatement call = null;
        try {
          db = new DBconn();
          con = db.getConnection();
          call = con.prepareCall("call p_dtsgfztj_getsql(?,?,?,?)");
          call.registerOutParameter(4, java.sql.Types.VARCHAR);
          call.setString(1, startDate);
          call.setString(2, endDate);
          call.setString(3, type);
          rs = call.executeQuery();
          sql = call.getString(4);
        }
        catch (ConnectionException e) {
          throw new DAOException(e, "统计报表失败!");
        }
        catch (SQLException e) {
          throw new DAOException(e);
        }
        finally {
          if (rs != null) {
            try {
              rs.close(); //关闭结果集
            }
            catch (Exception e) {
              e.printStackTrace();
            }
          }
          if (call != null) {
            try {
              call.close();
            }
            catch (Exception e) {
              e.printStackTrace();
            }
          }
          if (con != null) {
            try {
              con.close(); //关闭连接
            }
            catch (Exception e) {
              e.printStackTrace();
            }
          }
        }
        return sql;
      }
      

  5.   

    asp是可以的:
    Set DataConn = Server.CreateObject("ADODB.Connection")sql = " execute procedure sp1(1,2,...) "
    DataConn.Execute sql
      

  6.   

    有没有谁知道php的解决办法?