请问在宿主语言里可以执行此条语句吗? ResultSet rs=stmt.executeUpdate("insert tablename(firstcolumn) select firstcolumn from othertable"); 不行吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 stmt.executeUpdate("insert tablename(firstcolumn) select firstcolumn from othertable"); 要不就用存储过程! 我用的不是java是别的语言。存储过程只能创建本局临时表,而存储过程一旦退出,临时表就不存在我还想用它。但如果创建全局存储过程的话。如果程序在非正常退出的情况下退出。全局临时表是无法消失的。其他用户创建此表不是不可能了吗? ResultSet rs=stmt.executeUpdate("insert tablename(firstcolumn) select firstcolumn from othertable");我是过可以的 import java.sql.*;public class Data{public static void main(String args[]){try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection con=DriverManager.getConnection("jdbc:odbc:freight","","");Statement st=con.createStatement();st.execute("create table #citymenu(cityname varchar(20))");System.out.println("OK");st.executeUpdate("insert into #citymenu select cityname from citybaseinfo ");while (rs.next()){System.out.println(rs.getString(1));}}catch(Exception e){System.out.println(e);}}}不好用呀。 同一个表,SELECT同时再进行INSERT的问题! 一简单的有关数据库的权限问题!!! 帮我看看这个sql语句 有一题目,弄的很迷糊,上来请教各位高手,大侠!~ 这个存储过程该怎么完成阿,在线等~~~~~着急~~~ 启动 Service Broker 没有反应,急求高手解答 存储过程中使用动态sql语句,执行时输入参数提示列名无效 按月统计问题.... 为什么我这个存贮过程返回的值都为空呀? 变量数组 微软的数据库 两个日期型字段相减的问题?UP者有分? 高手进,如何判断ms sql中数据库的状态???
我还想用它。但如果创建全局存储过程的话。如果程序在非正常退出的情况下退出。全局临时表是无法消失的。其他用户创建此表不是不可能了吗?
我是过可以的
public class Data
{
public static void main(String args[])
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:freight","","");
Statement st=con.createStatement();st.execute("create table #citymenu(cityname varchar(20))");
System.out.println("OK");
st.executeUpdate("insert into #citymenu select cityname from citybaseinfo ");
while (rs.next())
{
System.out.println(rs.getString(1));
}
}catch(Exception e)
{
System.out.println(e);
}
}
}
不好用呀。