Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Parsing Query Text

Parsing Query Text

From: Axe <way_at_too.much.spam>
Date: Tue, 27 May 2003 13:36:21 GMT
Message-ID: <pRJAa.18752$Io.1682630@newsread2.prod.itd.earthlink.net>


I'm working on a windows app using C# that will be able to connect to either SQL Server or Oracle. I'll part of my project is a "query builder" however the user will interact with dropdowns and checkboxes so there is no chance that tablenames or fieldnames will be mispelled. Mostly I'd just like to run the SQL query through the DB and parse it for syntax errors (incorrect number of parenthesis, etc.). To do this in SQL Server you use the command SET PARSEONLY and I'll be using it like this (although this is VB.Net code):

    Dim con As New SqlConnection("...")
    con.open()
    Call New SqlCommand("Set parseonly on", con).ExecuteNonQuery()     Try

      dim SQL as string = "create procedure foo as select *, from t"
      Call New SqlCommand(SQL,con).ExecuteNonQuery()
    Catch ex As SqlException
      Trace.Write(ex.ToString)
    Finally
      Call New SqlCommand("Set parseonly off", con).ExecuteNonQuery()
    End Try

Now, the question of the day is this: What's the Oracle equivalent of SET PARSEONLY? Is this possible?

Please don't get all "Oracle" on me and tell me to read textbooks and how bad I am for using SQL Server, OK! If you can help, fine, if not you don't have to waste your time. I know that I'll be learning more about Oracle as soon as I get to that point. I just need to know if this is possible--letting Oracle parse the query for me.

Axe Received on Tue May 27 2003 - 08:36:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US