Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Executing a Script on an Oracle DB
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Executing a Script on an Oracle DB
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 -- Regards, Tom Ogilvy "EWill" wrote in message om... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why are my functions not executing? | Excel Worksheet Functions | |||
EXECUTING A FORMULA | New Users to Excel | |||
executing a macro within another | Excel Discussion (Misc queries) | |||
Forumlas Not Executing | Excel Discussion (Misc queries) | |||
Code Changes Not Executing | Excel Programming |