7 Replies - 1640 Views - Last Post: 26 February 2011 - 12:36 PM Rate Topic: -----

#1 Guest_Matt*


Reputation:

SQL error checker

Posted 24 February 2011 - 11:52 AM

Hi,

I am putting together a little app that puts together SQL statements based on the answers to a string of questions that are defined in an external file.
I have got the SQL string formatted and have parsed it by MSSQLParser so it is now in RTF format.
All I need to do is check the contents of the string for any errors that may have been introduced by user inputs.
I have access to the database, but the databases are huge and running the queries would take an absolute age.

any help would be great

Is This A Good Question/Topic? 0

Replies To: SQL error checker

#2 Ionut  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 385
  • View blog
  • Posts: 1,053
  • Joined: 17-July 10

Re: SQL error checker

Posted 24 February 2011 - 02:13 PM

Can you give a simple example? I don't know how this string looks like and what input errors do you want to avoid.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_matt*


Reputation:

Re: SQL error checker

Posted 25 February 2011 - 12:50 AM

The issue is that the statements are wildly varied and the separate components of the statement can be defined by the user.

The system is basically a method of storing all joins information.

User selects tables, user inputs a few conditions via combo boxes, data not validated as data types vary depending on field selected. Process continues allowing multiple fields per table, and populating aspects of the query as it goes. At the end the user can then make adjustments to the string through a richtextbox.

All I would like to do is submit the sql to the database in a non executing method so the server comes back with either Valid/table make not known/invalid.
Was This Post Helpful? 0

#4 Elda  Icon User is offline

  • D.I.C Regular

Reputation: 31
  • View blog
  • Posts: 314
  • Joined: 30-December 10

Re: SQL error checker

Posted 25 February 2011 - 01:50 AM

Can you show a bit major codes of your program?
Was This Post Helpful? 0
  • +
  • -

#5 Guest_matt*


Reputation:

Re: SQL error checker

Posted 25 February 2011 - 11:38 AM

I am not sure how my code is relevant. My sql is generated from user input strings which vary hugely from one query to the next, I just want to either send the query to the database with either the oracleinprocserver or dao/ado and get a response. These queries cB take up to 20mins to return so a full query of the database is not feasible.

I tried using "set noexec on" but the Oracle server being used doesn't accept it.
Was This Post Helpful? 0

#6 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 549
  • View blog
  • Posts: 2,908
  • Joined: 19-May 09

Re: SQL error checker

Posted 25 February 2011 - 02:42 PM

I see what you're trying to do. You want to do the equivalent of checking the validity of the string before submitting it. If you want to do that, you're going to have to be more rigorous about what you're calling an error. Are you just trying to trap syntax errors, for example, or perhaps a user wants to insert an entire table of 150,000 records with a couple of duplicate logical keys and you want to trap that. (That would be a lot harder.) So, what do you want to do?
Was This Post Helpful? 0
  • +
  • -

#7 Guest_matt*


Reputation:

Re: SQL error checker

Posted 26 February 2011 - 02:20 AM

The application already limits the user to select statements only. I just want to submit to the server for syntax and semantics parsing. And then return yes/no to to the user. Preferably with the position of the error. but that is not 100 percent necessary
Was This Post Helpful? 0

#8 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 549
  • View blog
  • Posts: 2,908
  • Joined: 19-May 09

Re: SQL error checker

Posted 26 February 2011 - 12:36 PM

I found this by googling "oracle check syntax": http://www.wangz.net/esqlchk.htm maybe that works for you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1