Discussion:
SQL Syntax Check
(too old to reply)
mason
2008-07-21 18:08:36 UTC
Permalink
Besides -x option for dbisql, is there a stored procedure or statements to
call to do syntax check for an SQL statement? Thanks.
Mark Culp
2008-07-22 02:07:22 UTC
Permalink
What version are you using?

If you are connected to a database, you can use any of the builtin functions
that take a query as a parameter and check the result to see if the query
was parsed corrected (and passed semantic analysis).
For example, look at these functions in the docs:
rewrite()
sqldialect()
watcomsql()
transactsql()
sqlflagger()
estimate()
and many others. (depending on which version you are using, some of these
functions may not be available - I've pulled this list from the 11.0.0 docs).
--
Mark Culp
SQLAnywhere Research and Development
iAnywhere Solutions Engineering
-------------------------------------------------------------------------
-- SQL Anywhere Blog Center - http://www.sybase.com/sqlanyblogs
-- SQL Anywhere Developer Community:
-- http://www.sybase.com/developer/library/sql-anywhere-techcorner
-------------------------------------------------------------------------
Post by mason
Besides -x option for dbisql, is there a stored procedure or statements to
call to do syntax check for an SQL statement? Thanks.
mason
2008-07-22 13:44:06 UTC
Permalink
ASA9. rewrite(), watcomsql(), and transactsql() should work. Thanks.
Post by Mark Culp
What version are you using?
If you are connected to a database, you can use any of the builtin functions
that take a query as a parameter and check the result to see if the query
was parsed corrected (and passed semantic analysis).
rewrite()
sqldialect()
watcomsql()
transactsql()
sqlflagger()
estimate()
and many others. (depending on which version you are using, some of these
functions may not be available - I've pulled this list from the 11.0.0 docs).
--
Mark Culp
SQLAnywhere Research and Development
iAnywhere Solutions Engineering
-------------------------------------------------------------------------
-- SQL Anywhere Blog Center - http://www.sybase.com/sqlanyblogs
-- http://www.sybase.com/developer/library/sql-anywhere-techcorner
-------------------------------------------------------------------------
Post by mason
Besides -x option for dbisql, is there a stored procedure or statements to
call to do syntax check for an SQL statement? Thanks.
mason
2008-07-22 13:53:21 UTC
Permalink
This message from these functions is not as detailed as those from
dbisql -x, but it's OK for my requirements. If Sybase decides to add a
syntax check function or procedure in the future, that would be better.
Post by mason
ASA9. rewrite(), watcomsql(), and transactsql() should work. Thanks.
"Mark Culp"
Post by Mark Culp
What version are you using?
If you are connected to a database, you can use any of the builtin functions
that take a query as a parameter and check the result to see if the query
was parsed corrected (and passed semantic analysis).
rewrite()
sqldialect()
watcomsql()
transactsql()
sqlflagger()
estimate()
and many others. (depending on which version you are using, some of these
functions may not be available - I've pulled this list from the 11.0.0 docs).
--
Mark Culp
SQLAnywhere Research and Development
iAnywhere Solutions Engineering
-------------------------------------------------------------------------
-- SQL Anywhere Blog Center - http://www.sybase.com/sqlanyblogs
-- http://www.sybase.com/developer/library/sql-anywhere-techcorner
-------------------------------------------------------------------------
Post by mason
Besides -x option for dbisql, is there a stored procedure or statements to
call to do syntax check for an SQL statement? Thanks.
Loading...