@JdbcInsert 插入多个条目
我正在尝试使用 JavaScript @JdbcInsert 方法将条目插入到我的 DB2 数据库中.而且效果很好.
<上一页>变量我的数据={文档类型:类型",文档号:1,文档名称:名称"}@JdbcInsert("db2", "MYTABLE", myData);我需要的是一次插入多个条目..所以我需要以某种方式更改 myData 对象..但我应该怎么做..假设我需要类似
<上一页>变量我的数据={{文档类型:类型",文档号:1,文档名称:名称 1"},{文档类型:类型",文档号:1,文档名:name2"}}但它并没有真正起作用..
解决方案试试这个,var myData=[{
文档类型:类型",
DOCID: 1,
文档名称:name1"
},{文档类型:类型",
DOCID: 1,
文档名称:name2"
}]
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);
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..
解决方案try this, var myData=[{
DOCTYPE: "type",
DOCID: 1,
DOCNAME: "name1"
},{
DOCTYPE: "type",
DOCID: 1,
DOCNAME: "name2"
}]
相关文章