Re: Multiple SQL statement problem

From: Candyman <Candyman10000_at_msn.com>
Date: Tue, 20 Aug 2002 14:55:18 +0200
Message-ID: <3d623b4f$0$275$ba620e4c_at_news.skynet.be>


SQL Plus runs the statements 1 at a time, so it works

the execute sends 1 statement to Oracle so it won't work (try typing the same thing in Toad or SQL Navigator, same problem)

So it has to be run as a script

use a shell sqlplus way to do this

Greetz

Candyman

"evgenyv" <evgenyv_at_yahoo.com> wrote in message news:1716024.1029831128_at_dbforums.com...
>
> Hi!
> A can't run the multiple sql statement with Oracle DB. I'm using ADO
> 2.7.
> What is wrong in follow example?
>
> 'm_sConnStr = "Provider=MSDAORA;Password=aaa;User ID=user;Data
> Source=ds1"
> m_sConnStr = "Provider=OraOLEDB.Oracle;Password=aaa;User ID=user;Data
> Source=ds1"
> m_Conn.Open m_sConnStr
> m_Conn.CursorLocation = adUseClient
> Dim str1 As String
> Dim str2 As String
> Dim str3 As String
>
> str1 = "select * from test1 where id = 'www' ;" & vbCrLf
> str2 = "select * from test2 where id = 'eee';"
> str3 = str1 + str2
> Set m_Rs = m_Conn.Execute( str3 ) - throw error "Invalid character" (
> but this statement does run properly from Oracle SQL+ )
> m_Rs.Close
>
> BTW in MSSQL does work properly.
>
> Thanks in advance
>
> --
> EvgenyV
>
>
> Posted via http://dbforums.com
>
Received on Tue Aug 20 2002 - 14:55:18 CEST

Original text of this message