cat empty to null depending on new flag
This commit is contained in:
parent
1020edb0e3
commit
b4b3b7a25a
@ -233,7 +233,7 @@ Sub price_load_plcore()
|
|||||||
Next i
|
Next i
|
||||||
sql = "DELETE FROM rlarp.plcore WHERE listcode in (" & sql & ");"
|
sql = "DELETE FROM rlarp.plcore WHERE listcode in (" & sql & ");"
|
||||||
sql = sql & vbCrLf & "INSERT INTO rlarp.plcore"
|
sql = sql & vbCrLf & "INSERT INTO rlarp.plcore"
|
||||||
sql = sql & vbCrLf & x.SQLp_build_sql_values(load, True, True, PostgreSQL, False, "S", "S", "S", "S", "S", "S", "S", "N", "N", "S", "N", "N") & ";"
|
sql = sql & vbCrLf & x.SQLp_build_sql_values(load, True, True, PostgreSQL, False, False, "S", "S", "S", "S", "S", "S", "S", "N", "N", "S", "N", "N") & ";"
|
||||||
|
|
||||||
If Not x.ADOp_Exec(0, sql, 1, True, PostgreSQLODBC, "usmidlnx01", False, login.tbU, login.tbP, "Port=5030;Database=ubm") Then
|
If Not x.ADOp_Exec(0, sql, 1, True, PostgreSQLODBC, "usmidlnx01", False, login.tbU, login.tbP, "Port=5030;Database=ubm") Then
|
||||||
MsgBox (x.ADOo_errstring)
|
MsgBox (x.ADOo_errstring)
|
||||||
@ -254,7 +254,7 @@ End Sub
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Sub build_upload()
|
Sub build_csv()
|
||||||
|
|
||||||
Dim x As New TheBigOne
|
Dim x As New TheBigOne
|
||||||
Dim pl() As String
|
Dim pl() As String
|
||||||
|
@ -2460,7 +2460,7 @@ Function MISCe_col_to_letter(ByRef x As Long) As String
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
Public Function SQLp_build_sql_values(ByRef tbl() As String, trim As Boolean, headers As Boolean, syntax As SQLsyntax, ByRef quote_headers As Boolean, ParamArray typeflag()) As String
|
Public Function SQLp_build_sql_values(ByRef tbl() As String, trim As Boolean, headers As Boolean, syntax As SQLsyntax, ByRef quote_headers As Boolean, empty_as_null As Boolean, ParamArray typeflag()) As String
|
||||||
|
|
||||||
|
|
||||||
Dim i As Long
|
Dim i As Long
|
||||||
@ -2553,7 +2553,7 @@ Public Function SQLp_build_sql_values(ByRef tbl() As String, trim As Boolean, he
|
|||||||
End If
|
End If
|
||||||
Case "S" '-------S = string------------------------------------------
|
Case "S" '-------S = string------------------------------------------
|
||||||
rx.Pattern = strip_text
|
rx.Pattern = strip_text
|
||||||
If LTrim(RTrim(tbl(j, i))) = "" Then
|
If LTrim(RTrim(tbl(j, i))) = "" And empty_as_null Then
|
||||||
rec = rec & "CAST(NULL AS " & nullText & ")"
|
rec = rec & "CAST(NULL AS " & nullText & ")"
|
||||||
Else
|
Else
|
||||||
If trim Then
|
If trim Then
|
||||||
@ -2565,7 +2565,7 @@ Public Function SQLp_build_sql_values(ByRef tbl() As String, trim As Boolean, he
|
|||||||
End If
|
End If
|
||||||
Case "A" '-------A = string but dont apply any regex------------------
|
Case "A" '-------A = string but dont apply any regex------------------
|
||||||
rx.Pattern = strip_text
|
rx.Pattern = strip_text
|
||||||
If LTrim(RTrim(tbl(j, i))) = "" Then
|
If LTrim(RTrim(tbl(j, i))) = "" And empty_as_null Then
|
||||||
rec = rec & "CAST(NULL AS " & nullText & ")"
|
rec = rec & "CAST(NULL AS " & nullText & ")"
|
||||||
Else
|
Else
|
||||||
If trim Then
|
If trim Then
|
||||||
@ -2584,7 +2584,7 @@ Public Function SQLp_build_sql_values(ByRef tbl() As String, trim As Boolean, he
|
|||||||
End If
|
End If
|
||||||
Case Else '-------Assume text------------------------------------------
|
Case Else '-------Assume text------------------------------------------
|
||||||
rx.Pattern = strip_text
|
rx.Pattern = strip_text
|
||||||
If LTrim(RTrim(tbl(j, i))) = "" Then
|
If LTrim(RTrim(tbl(j, i))) = "" And empty_as_null Then
|
||||||
rec = rec & "CAST(NULL AS " & nullText & ")"
|
rec = rec & "CAST(NULL AS " & nullText & ")"
|
||||||
Else
|
Else
|
||||||
If trim Then
|
If trim Then
|
||||||
|
Loading…
Reference in New Issue
Block a user