I'm making an oracle query from vba and ran into the limitation that there can't be more than 1000 entries in a SQL IN statement.
LRow_Last_Product = Workbooks("test.xlsm").Worksheets("Check").Range("A" & Rows.Count).End(xlUp).Row For Each RngZelle In Workbooks("test.xlsm").Worksheets("Check").Range("A7:A" & LRow_Last_Product) If StrISINs = "" Then StrISINs = "'" & RngZelle.Value & "'" Else StrISINs = StrISINs & ", '" & RngZelle.Value & "'" End If Next RngZelle'WHEREStrSQL = StrSQL & "t.externref IN (" & StrISINs & ")"
I was thinking about creating a function that would generate a second IN with an OR if there are more than 1000 parameters. What is the most efficient way to solve this?
Thanks