动态SQL-检查语法和语义 [英] Dynamic SQL - Check syntax and semantics

查看:312
本文介绍了动态SQL-检查语法和语义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Oracle动态SQL可以执行包含SQL语句的字符串.例如

With Oracle dynamic SQL one is able to execute a string containing a SQL statement. e.g.

l_stmt := 'select count(*) from tab1';
execute immediate l_stmt;

是否可以不执行l_stmt,而是以编程方式检查语法和语义是否正确?

Is it possible to not execute l_stmt but check that the syntax and semantics is correct programmitically?

推荐答案

我认为唯一的解决方案"是使用DBMS_SQL.PARSE().

I think that the only "solution" is to use DBMS_SQL.PARSE().

这不是完美的,但它是您可以获得的最好的

It is not perfect but it is the best that you can get

这篇关于动态SQL-检查语法和语义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆