问题描述
从Raw SQL Select插入表
val rawSql: DBIO[Vector[(String,String)]] = sql"SELECT id,name FROM SomeTable".as[(String,String)]
val myTable :TableQuery[MyClass] // with columns id (String),name(String) and some other columns
是否可以使用forceInsert
函数将select中的数据插入表中?
如果不是,是否可以使用forceInsertStatements
生成sql字符串?
像这样:
db.run {
myTable.map{ t => (t.id,t.name)}.forceInsert????(rawSql)
}
P.S。我不想进行两个I / O调用,因为我的RAW SQL可能返回数千条记录。 感谢您的帮助。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)