gpt4 book ai didi

mysql - 使用 pentaho Spoon 更新数据库中的每日数据

转载 作者:行者123 更新时间:2023-11-29 22:41:23 25 4
gpt4 key购买 nike

我有一个如下所述的 SQL 查询,这将每天更新数据库比较日期(最新附加的日期数据将在数据库中更新),我想使用 Pentaho 数据集成(Kettle)在转换中执行此操作。

Do While i < dgTest.RowCount
dd = Mid(dgTest.Item(2, i).Value, 5, 2) & "/" & Mid(dgTest.Item(2, i).Value, 7, 2) & "/" & Mid(dgTest.Item(2, i).Value, 1, 4)

Sql = "INSERT INTO cash ([comp], strno, bday, openread, curread,refqty,refamt, promoq," & _
" promoa, netsprod, netsnprod, eatintc, eatins, eatouttc, eatouts, " & _
" dttc, coffeetc, dts, coffeesales, csh, cover,recamt,crsalesamt ) Values " & _
" ('" & dgTest.Item(0, i).Value.ToString & "','" & dgTest.Item(1, i).Value.ToString & _
"',#" & CDate(dd) & "#,'" & dgTest.Item(3, i).Value.ToString & "'," & dgTest.Item(4, i).Value & "," & _
dgTest.Item(5, i).Value & "," & dgTest.Item(6, i).Value & _
"," & dgTest.Item(7, i).Value & _
"," & dgTest.Item(8, i).Value & "," & dgTest.Item(9, i).Value & _
"," & dgTest.Item(10, i).Value & "," & dgTest.Item(11, i).Value & _
"," & dgTest.Item(12, i).Value & "," & dgTest.Item(13, i).Value & "," & dgTest.Item(14, i).Value & _
"," & dgTest.Item(15, i).Value & "," & dgTest.Item(16, i).Value & "," & dgTest.Item(17, i).Value & "," & dgTest.Item(18, i).Value & "," & dgTest.Item(19, i).Value & "," & dgTest.Item(20, i).Value & "," & dgTest.Item(21, i).Value & "," & dgTest.Item(22, i).Value & ")"

cmd = New OleDbCommand(Sql, con)
cmd.ExecuteNonQuery()

i = i + 1
Loop

最佳答案

我不明白你想要实现的方法,但你可以做的是从输入表步骤读取数据,使用修改后的java脚本并指定在这个特定时间更新数据库..示例

    var d = new Date();
var hour1 = d.getHours();

if(hour1==14)
{
if(d.getDate()==day2 && month1==month2 && year1==year2 && hour>=13 && hour<17)
}

关于mysql - 使用 pentaho Spoon 更新数据库中的每日数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29326645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com