临时sql的列名称 [英] column names for an ad-hoc sql
问题描述
我的程序将获得有效sql的输入,并应返回sql的列名. 我想完全不执行sql语句来执行此操作.我正在寻找Java解决方案.
My programm will get an input of a valid sql, and should return column names for the sql. And I want to do this with out executing the sql statement at all. I am looking for a java solution.
我的dbms针对olap进行了oracle优化,并且表太大,结果集限制不起作用.对于我的情况,实际上执行时间是不可接受的.花了超过一分钟的时间
My dbms is oracle optimized for olap, and the tables are so big that result set restriction does not working. Actually execution time is not acceptable for my case. it takes longer than a minute
推荐答案
Prepare the query, but rather than executing it, just call getMetaData on the prepared statement. Provided your driver supports it, this should return the result set meta data with the column descriptions without executing a query.
这篇关于临时sql的列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!