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
SQL error checker
Page 1 of 17 Replies - 1640 Views - Last Post: 26 February 2011 - 12:36 PM
Replies To: SQL error checker
#2
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.
#3 Guest_matt*
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.
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.
#4
Re: SQL error checker
Posted 25 February 2011 - 01:50 AM
Can you show a bit major codes of your program?
#5 Guest_matt*
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.
I tried using "set noexec on" but the Oracle server being used doesn't accept it.
#6
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?
#7 Guest_matt*
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
#8
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.
Page 1 of 1
|
|

New Topic/Question
Reply
MultiQuote






|