在oracle:form中使用动态SQL
Jun 07, 2016 pm 02:54 PM
f
form
oracle
sql
use
dynamic
在oracle FORM 由于和DB中的 不一样所以需要一个特定的API exec_sql系列 ,常常用来输出报表的东东 FORM dynamic SQL 动态SQL PL/SQL declare l_sql varchar2(2000); v_ConnID EXEC_SQL.CONNTYPE; v_Cursor EXEC_SQL.CURSTYPE; v_Ignore PLS_INTEGER;begin --
在oracle FORM 由于和DB中的 不一样所以需要一个特定的API exec_sql系列 ,常常用来输出报表的东东 FORM dynamic SQL 动态SQL PL/SQLdeclare l_sql varchar2(2000); v_ConnID EXEC_SQL.CONNTYPE; v_Cursor EXEC_SQL.CURSTYPE; v_Ignore PLS_INTEGER; begin --... 你进行相应的 动态SQL 拼接的地方 --写内容 --执行查询 并且关闭相应的 连接资源 v_ConnID := EXEC_SQL.DEFAULT_CONNECTION; v_Cursor := EXEC_SQL.OPEN_CURSOR(v_ConnID); -- 使用 API EXEC_SQL.DEFINE_COLUMN( v_ConnID,v_Cursor, v_Count, v_Value, 100); 进行返回值的定义 EXEC_SQL.PARSE(v_ConnID, v_Cursor, l_sql, EXEC_SQL.V7); v_ignore := EXEC_SQL.EXECUTE(v_ConnID, v_Cursor); --写入数据 使用 从游标抓取数据 然后 获取值的API --WHILE (EXEC_SQL.FETCH_ROWS(v_ConnID, v_Cursor ) > 0 ) LOOP -- EXEC_SQL.COLUMN_VALUE(v_ConnID, v_Cursor, v_Count, v_Value); --END LOOP; EXEC_SQL.CLOSE_CURSOR(v_ConnID, v_Cursor); EXEC_SQL.CLOSE_CONNECTION(v_ConnID); end;
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Function to calculate the number of days between two dates in oracle

How long will Oracle database logs be kept?

The order of the oracle database startup steps is

Oracle database server hardware configuration requirements

How to see the number of occurrences of a certain character in Oracle
