Executing a Script on an Oracle DB

  • Thread starter Thread starter EWill
  • Start date Start date
E

EWill

I have a rather lengthy script I need to execute from within Excel,
however the scipt will not fit into a string (the script is about 2.5
pages long). How can I pass a long SQL stmt to oracle.

Note: The script will not return any results its an select/insert
stmt, based on criteria from the excel spreadsheet.
 
Put it into an array of 127 character elements:

so if you had a named argument querytext
queryText:=MakeSQLArray(QueryString)


'Function MakeSQLArray converts a string into an array of strings,
'each element being a string that is 127 characters or less.
Function MakeSQLArray(ByVal String1 As String)
Dim ArraySize As Integer
Dim SQLArray() As String
Dim x As Integer
ArraySize = 1 + Int((Len(String1) - 1) / 127)
If ArraySize < 1 Then
ArraySize = 1
End If
ReDim SQLArray(ArraySize) As String
For x = 1 To ArraySize
SQLArray(x) = Left(String1, 127)
If Len(String1) > 127 Then
String1 = Right(String1, Len(String1) - 127)
End If
Next
MakeSQLArray = SQLArray
End Function
 
Back
Top