Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why are my functions not executing? Charlie Excel Worksheet Functions 1 March 3rd 09 11:21 PM
EXECUTING A FORMULA Theresa New Users to Excel 4 January 18th 07 06:09 PM
executing a macro within another brian Excel Discussion (Misc queries) 3 July 5th 06 01:22 AM
Forumlas Not Executing Trey Excel Discussion (Misc queries) 2 January 25th 06 04:02 PM
Code Changes Not Executing Justin[_8_] Excel Programming 1 October 24th 03 02:31 AM


All times are GMT +1. The time now is 09:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"