Is there a command to test an SQL query without executing it? ( MySQL or ANSI SQL )
Posted
by Petruza
on Stack Overflow
See other posts from Stack Overflow
or by Petruza
Published on 2010-03-12T15:13:30Z
Indexed on
2010/03/12
15:17 UTC
Read the original article
Hit count: 192
Is there anything like this:
TEST DELETE FROM user WHERE somekey = 45;
That can return any errors, for example that somekey doesn't exist, or some constraint violation or anything, and reporting how many rows would be affected, but not executing the query?
I know you can easily turn any query in a select query that has no write or delete effect in any row, but that can lead to errors and it's not very practical if you want to test and debug many queries.
© Stack Overflow or respective owner