本文介绍了@JdbcInsert插入多个条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图通过使用JavaScript @JdbcInsert方法在DB2数据库中插入一个条目。它的工作完美。
I'm trying to insert an entry into my DB2 db by using JavaScript @JdbcInsert method. And it works perfect.
var myData={
DOCTYPE: "type",
DOCID: 1,
DOCNAME: "name"
}
@JdbcInsert("db2", "MYTABLE", myData);
我需要的是一次插入多个条目。所以我需要改变myData对象,但我该怎么办那假设我需要像
What I need is to insert multiple entries at a time.. So I need to change myData object somehow.. But how should I do that.. Assume I need something like
var myData={{
DOCTYPE: "type",
DOCID: 1,
DOCNAME: "name1"
},{
DOCTYPE: "type",
DOCID: 1,
DOCNAME: "name2"
}}
但它没有真正的工作..
but it doesn't really work..
推荐答案
尝试这个,var myData = [{
DOCTYPE:type,
DOCID:1,
DOCNAME: name1
},{
DOCTYPE:type,
DOCID:1,
DOCNAME:name2
}]
try this, var myData=[{
DOCTYPE: "type",
DOCID: 1,
DOCNAME: "name1"
},{ DOCTYPE: "type",
DOCID: 1,
DOCNAME: "name2"
}]
这篇关于@JdbcInsert插入多个条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!