shift everything to the right to accommodate weight, include postgres only merge for testing
This commit is contained in:
parent
33c49f3463
commit
a448efe0b1
38
targets.bas
38
targets.bas
@ -16,12 +16,12 @@ Sub get_options()
|
|||||||
|
|
||||||
sql = "SELECT * FROM rlarp.get_options('" & mold & "');"
|
sql = "SELECT * FROM rlarp.get_options('" & mold & "');"
|
||||||
res = x.ADOp_SelectS(0, sql, True, 100, True, PostgreSQLODBC, "usmidlnx01", False, "report", "", "Port=5030;Database=ubm")
|
res = x.ADOp_SelectS(0, sql, True, 100, True, PostgreSQLODBC, "usmidlnx01", False, "report", "", "Port=5030;Database=ubm")
|
||||||
ws.Range("L1:O350").ClearContents
|
ws.Range("M1:P350").ClearContents
|
||||||
Call x.SHTp_Dump(res, ws.Name, 1, 12, False, True, 13)
|
Call x.SHTp_Dump(res, ws.Name, 1, 13, False, True, 15)
|
||||||
|
|
||||||
sql = "SELECT * FROM rlarp.get_option_costs('" & mold & "');"
|
sql = "SELECT * FROM rlarp.get_option_costs('" & mold & "');"
|
||||||
res = x.ADOp_SelectS(0, sql, True, 100, True, PostgreSQLODBC, "usmidlnx01", False, "report", "", "Port=5030;Database=ubm")
|
res = x.ADOp_SelectS(0, sql, True, 100, True, PostgreSQLODBC, "usmidlnx01", False, "report", "", "Port=5030;Database=ubm")
|
||||||
ws.Range("C1:J350").ClearContents
|
ws.Range("C1:K350").ClearContents
|
||||||
Call x.SHTp_Dump(res, ws.Name, 1, 3, False, True, 8)
|
Call x.SHTp_Dump(res, ws.Name, 1, 3, False, True, 8)
|
||||||
|
|
||||||
Call x.ADOp_CloseCon(0)
|
Call x.ADOp_CloseCon(0)
|
||||||
@ -53,8 +53,8 @@ Sub combine_options()
|
|||||||
res = x.ADOp_SelectS(0, sql, True, 5000, True, PostgreSQLODBC, "usmidlnx01", False, "report", "", "Port=5030;Database=ubm")
|
res = x.ADOp_SelectS(0, sql, True, 5000, True, PostgreSQLODBC, "usmidlnx01", False, "report", "", "Port=5030;Database=ubm")
|
||||||
Call x.ADOp_CloseCon(0)
|
Call x.ADOp_CloseCon(0)
|
||||||
|
|
||||||
ws.Range("Q1:AC5000").ClearContents
|
ws.Range("R1:AD5000").ClearContents
|
||||||
Call x.SHTp_Dump(res, ws.Name, 1, 17, False, True)
|
Call x.SHTp_Dump(res, ws.Name, 1, 18, False, True)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@ -76,8 +76,8 @@ Sub save_targets()
|
|||||||
|
|
||||||
Set ws = ActiveSheet
|
Set ws = ActiveSheet
|
||||||
|
|
||||||
opt = x.SHTp_Get(ws.Name, 1, 12, True)
|
opt = x.SHTp_Get(ws.Name, 1, 13, True)
|
||||||
tar = x.SHTp_Get(ws.Name, 1, 17, True)
|
tar = x.SHTp_Get(ws.Name, 1, 18, True)
|
||||||
|
|
||||||
path = Sheets("env").Cells(1, 2) & "\" & ActiveSheet.Cells(2, 1) & "\options.csv"
|
path = Sheets("env").Cells(1, 2) & "\" & ActiveSheet.Cells(2, 1) & "\options.csv"
|
||||||
If Not x.FILEp_CreateCSV(path, opt) Then
|
If Not x.FILEp_CreateCSV(path, opt) Then
|
||||||
@ -90,13 +90,14 @@ Sub save_targets()
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'--------------------mssql merge----------------------------
|
||||||
sql() = x.FILEp_GetTXT(Sheets("env").Cells(1, 2) & "\000\merge.sql", 1000)
|
sql() = x.FILEp_GetTXT(Sheets("env").Cells(1, 2) & "\000\merge.sql", 1000)
|
||||||
|
|
||||||
For i = LBound(sql, 2) To UBound(sql, 2)
|
For i = LBound(sql, 2) To UBound(sql, 2)
|
||||||
sqlt = sqlt & sql(0, i) & vbCrLf
|
sqlt = sqlt & sql(0, i) & vbCrLf
|
||||||
Next i
|
Next i
|
||||||
|
|
||||||
targt = x.SQLp_build_sql_values(x.SHTp_Get(ws.Name, 1, 17, True), True, True, PostgreSQL, False, "N", "N", "S", "S", "S", "S", "S", "S", "N", "N", "N", "N", "N")
|
targt = x.SQLp_build_sql_values(x.SHTp_Get(ws.Name, 1, 18, True), True, True, PostgreSQL, False, "N", "N", "S", "S", "S", "S", "S", "S", "N", "N", "N", "N", "N")
|
||||||
|
|
||||||
sqlt = Replace(sqlt, "replace_this", targt)
|
sqlt = Replace(sqlt, "replace_this", targt)
|
||||||
|
|
||||||
@ -104,10 +105,25 @@ Sub save_targets()
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Foldername As String
|
'--------------------postgres merge----------------------------
|
||||||
Foldername = Sheets("env").Cells(1, 2) & "\" & ActiveSheet.Cells(2, 1)
|
sql() = x.FILEp_GetTXT(Sheets("env").Cells(1, 2) & "\000\merge.pg.sql", 1000)
|
||||||
|
|
||||||
Shell "C:\WINDOWS\explorer.exe """ & Foldername & "", vbNormalFocus
|
sqlt = ""
|
||||||
|
For i = LBound(sql, 2) To UBound(sql, 2)
|
||||||
|
sqlt = sqlt & sql(0, i) & vbCrLf
|
||||||
|
Next i
|
||||||
|
|
||||||
|
targt = x.SQLp_build_sql_values(x.SHTp_Get(ws.Name, 1, 18, True), True, True, PostgreSQL, False, "N", "N", "S", "S", "S", "S", "S", "S", "N", "N", "N", "N", "N")
|
||||||
|
|
||||||
|
sqlt = Replace(sqlt, "replace_this", targt)
|
||||||
|
|
||||||
|
If Not x.FILEp_Create(Sheets("env").Cells(1, 2) & "\" & ActiveSheet.Cells(2, 1) & "\merge.pg.sql", sqlt) Then
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Dim Foldername As String
|
||||||
|
'Foldername = Sheets("env").Cells(1, 2) & "\" & ActiveSheet.Cells(2, 1)
|
||||||
|
'Shell "C:\WINDOWS\explorer.exe """ & Foldername & "", vbNormalFocus
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
Loading…
Reference in New Issue
Block a user