How to check sql query syntax?

java 1.4 Sql 2000 server

I take the input of the sql query (to check the value of the field against the values โ€‹โ€‹obtained when executing the SQL query) from the administrator user, which will be stored in the database, and then I will execute the SQL query corresponding to the field. Before inserting a sql query into a database I want to check its syntax in Java code.

Fields         Sql Query

stateCode      select statecode from states
district code  select district code from districts
+3
source share
6 answers

I don't think there is any (simple) way to check sql

Sql syntax is complex and allows you to use different ways to enter instructions.

, sql statent, SQl, , , .

sql,

SET NOEXEC ON

+5
+8

sql-?

.

, . .

+3

, , , , . , .

+2

SET FMTONLY ON, , . SET FMTONLY OFF finally, .

+2

Source: https://habr.com/ru/post/1720653/


All Articles