sql corrector

Q

quikquic

Hi, I am looking for a library(j, c++, or algorithm) which can check
and correct sql. For example, if I have

selet * from employee where id in (select id from people where
name='john

The code can find the error and correct it to

select * from employee where id in (select id from people where
name='john')

Thanks,

qq
 
M

Michael Borgwardt

Hi, I am looking for a library(j, c++, or algorithm) which can check
and correct sql. For example, if I have

selet * from employee where id in (select id from people where
name='john

The code can find the error and correct it to

select * from employee where id in (select id from people where
name='john')

If you try to run it via JDBC and it's not correct, you'll get an SQLException,
that's your checking. As for "correcting", I doubt anybody is insane enough
to do that. In your example, how can it know that it wasn't supposed to end
name ='johnson') instead? What if this happens in a DELETE statement and you
lose all your data because a condition was truncated?
 
Q

quikquic

Michael Borgwardt said:
If you try to run it via JDBC and it's not correct, you'll get an SQLException,
that's your checking. As for "correcting", I doubt anybody is insane enough
to do that. In your example, how can it know that it wasn't supposed to end
name ='johnson') instead?

It check syntax error, not the content.
What if this happens in a DELETE statement and you
lose all your data because a condition was truncated?

It gives your a new sql but does not nessarily execute it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top