Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: ExecuteSql Problem (VB6/Oracle 9i )
I figured out my issue. I needed to replace the carriage returns wit a
linefeed before executing the script.
JP
"JP" <jplante_at_excite.com> wrote in message
news:e8yRa.3878$KZ.1291927_at_news1.news.adelphia.net...
> I wrote a small VB application that will read in an Oracle package from a
> text file and apply it to the database using the ExecuteSql function.
> The package is created on the database successfully but with the
> following error: "Encountered the symbol "" when expecting one of the
> following; begin end function pragma ....." The funny thing about
> this is that if I choose to edit the package, using Enterprise
> Manager, and then make a minor change to it just so it's modified (add
> a space anywhere in the text) it then compiles successfully without
> any errors. The process is done in two steps where the package
> definition is done first followed by the package body; in both cases
> I'm receiving the same error. I've also tried using CreateSql but I
> still receive the same error.
>
> The following is the function I wrote:
>
>
> Function ExecuteScripts() As Boolean
>
> Dim sFileName As String
> Dim sScript As String
> Dim nCount As Integer
>
> On Error GoTo Error_Handler
>
> ' Loop through the array of script names and execute them
> Do
> ' Get the filename of the script from the array
> sFileName = sFileArray(nCount)
>
> If sFileName <> "" Then
> ' Create the directory\filename string
> sFileName = GetFileDir() & sFileName
>
> ' Read in the script content
> sScript = ReadFile(sFileName)
>
> 'Execute the script
> OraDatabase.ExecuteSQL (sScript)
>
> Else
> Exit Do
> End If
>
> ' Increment the array counter
> nCount = nCount + 1
>
> Loop
>
>
>
> Error_Handler:
> If Err Then
> ExecuteScripts = False
> Err.Raise Err.Number, , Err.Description
> Else
> ExecuteScripts = True
> End If
>
> End Function
>
> Any help or advice would be appreciated.
>
> Thanks,
> JP
>
>
Received on Thu Jul 17 2003 - 13:58:04 CDT