Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / September 2006

Tip: Looking for answers? Try searching our database.

Getting Oracle Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sjoshi - 29 Sep 2006 17:19 GMT
Hi
I'm trying to run a queries on a schema, and I keep getting ORA-00911:
invalid character error. If I copy/paste it in SQL/Plus it runs fine.

This is what I'm doing in code:

//Set session here to ZGK037_MDB

string sqlSession = string.Format("ALTER SESSION SET
CURRENT_SCHEMA={0}", oDB.DatabaseName);

//Note I don't close the Connection Object in this call. It just gets
an OracleCommand Object
cmdOracle = MiscDataUtils.GetCommandObj(sqlSession, oDB.Connection);

//Execute the sqlSession query
cmdOracle.ExecuteNonQuery();

//This is what it shows in my logfile...so it looks like the above
worked with no exceptions
[Logging-DEBUG]-9/29/2006 10:22:45 AM
 [GetCommandObj]
  ALTER SESSION SET CURRENT_SCHEMA=ZGK037_MDB

Next I try to run a query on this command obj

cmdOracle.CommandText = sql; //Set to my new SQL string
rdr = MiscDataUtils.GetDataReaderFromCommandObj(cmdOracle);

This is what the log file says:

[Logging-DEBUG]-9/29/2006 10:22:45 AM
 [GetDataReaderFromCommandObj]
  Select RoFm.SymCount as Occ, csd.oid as SymbolOID, csd.m_progID as
ProgID, csd.m_version as ProgVersion From CORESymbolDefinition csd,
(Select Count(*) as SymCount, fm.m_defname as RoFmID  FROM
CORERelationOrigin RO JOIN COREFlavorMgr FM ON RO.oidTarget = FM.oid
JOIN CORESymbol S ON RO.oid = S.oid Group By fm.m_defname ) RoFm
Where csd.m_progID=RoFm.RoFmID Order by csd.m_progID;
  [Exception]
   ORA-00911: invalid character

Any help is really appreciated.

Sunit
sjoshi - 29 Sep 2006 20:35 GMT
Found it the problem was trailing semi-colon

Sunit

> Hi
> I'm trying to run a queries on a schema, and I keep getting ORA-00911:
[quoted text clipped - 41 lines]
>
> Sunit

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.