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 -> Re: Parsing Query Text

Re: Parsing Query Text

From: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Tue, 27 May 2003 14:22:49 GMT
Message-ID: <ZwKAa.1039246$S_4.1045297@rwcrnsc53>


At the C level (not C#) with OCI you can say parse and execute which will do what you want. So you could write a small C dll and pass it the string and have it parse and return sucess or the error message. Jim

-- 
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"Axe" <way_at_too.much.spam> wrote in message
news:pRJAa.18752$Io.1682630_at_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 - 09:22:49 CDT

Original text of this message

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