sybase jdbc 创建临时表

来源:互联网 发布:m1005找不到扫描软件 编辑:程序博客网 时间:2024/06/06 11:41
//判断临时表是否存在
String pd_l_sql = "select name from tempdb.dbo.sysobjects where name like '#table_name%' and type='U'";
rs = conn.executeQuery(pd_l_sql);
if(rs.next()){
conn.executeUpdate("drop table #table_name");

}


//创建临时表
String c_l_sql = "  create table #table_name( id int , name varchar(10))";

conn.executeUpdate(c_l_sql);


//向临时表中插入数据
String intoSql = "insert into #table_name (select   * from ......)
 conn.executeUpdate(intoSql);
0 0
原创粉丝点击