简体   繁体   中英

Parsing queries in Oracle SQL Developer

有没有办法解析SQL Developer(oracle)中的代码而不实际触及表/包数据,就像在SQL Management Studio中使用“parse”选项一样?

There is no option to merely parse the SQL statement to validate the syntax.

You could choose the "Explain Plan" option ( F10 in the Windows version of SQL Developer), that will validate the syntax as part of generating the query plan. If there is a syntax error, you'll get the error message when you attempt to generate the plan but you generally won't get the line and column of the error which makes debugging more challenging.

I was looking for this right now and couldn't find an option in Oracle SQL Developer.

I know a service called SQL Fiddle that can help in such situations where one needs to test/parse/validate an adhoc PL/SQL script. Using SQL Fiddle you can do this:

Select Oracle 11g R2 (as available right now) in the dropdown and type your script in the left text area. Press Build Schema button. If your script is valid then it'll show you Schema Ready message like this:

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM