DBMS_SQL例子
DECLARE
l_cursor PLS_INTEGER;
l_wareid t_ware_base.wareid%TYPE;
l_warename t_ware_base.warename%TYPE;
l_retval PLS_INTEGER;
BEGIN
l_cursor := dbms_sql.open_cursor;
dbms_sql.parse(l_cursor,
'select wareid, warename from t_ware_base where wareid like :wareid ',
1);
dbms_sql.define_column(l_cursor, 1, l_wareid);
dbms_sql.define_column(l_cursor, 2, l_warename, 100);
--dbms_sql.define_column(
dbms_sql.bind_variable(l_cursor, ':wareid', '%58%');
l_retval := dbms_sql.execute(l_cursor);
dbms_output.put_line('l_retval = ' || l_retval);
WHILE dbms_sql.fetch_rows(l_cursor) > 0 LOOP
dbms_sql.column_value(l_cursor, 1, l_wareid);
dbms_sql.column_value(l_cursor, 2, l_warename);
dbms_output.put_line(l_wareid || '-' || l_warename);
END LOOP;
/*IF dbms_sql.fetch_rows(l_cursor) > 0 THEN
dbms_sql.column_value(l_cursor, 1, l_wareid);
dbms_output.put_line(l_wareid);
ELSE
dbms_output.put_line('No rows returned');
END IF;*/
dbms_sql.close_cursor(l_cursor);
END;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-774798/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DBMS_SQLSQL
- 關於DBMS_SQL的使用SQL
- dbms_sql包所有子過程及函式SQL函式
- oracle dbms_sql執行查詢select_dml_ddl(一)OracleSQL
- ORACLE應用經驗(3)-DBMS_SQL封裝過程(轉)OracleSQL封裝
- dbms_sql之通用general及bulk批量(大體積)type 型別SQL型別
- 【python小例子】小例子拾憶Python
- split 例子
- java socket例子Java
- go channel例子Go
- oracle plsql例子OracleSQL
- Javacc的例子Java
- sqlldr的例子SQL
- Oracle12c中PL/SQL(DBMS_SQL)新特性之隱式語句結果OracleSQL
- CSS 權值例子CSS
- mybatis小例子2MyBatis
- Websocket簡單例子Web單例
- sax解析例子演示
- oracle 寫declare例子Oracle
- JSONP的例子JSON
- Redis 實際例子Redis
- webpack 入門例子Web
- websocket使用小例子Web
- java反射小例子Java反射
- Oracle審計例子Oracle
- JNI 簡單例子單例
- forward_list例子Forward
- GetMemory的典型例子
- Grails 使用MySQL例子AIMySql
- ibatis配置例子BAT
- HttpClient 簡單例子HTTPclient單例
- at new 的使用例子
- SqlServer遊標例子SQLServer
- TinyXML應用例子XML
- Qt表格排序例子QT排序
- dockerfile測試例子Docker
- 小例子理解多型多型
- Java String length()例子Java