pipelined-function

table function as physical table in Oracle BI EE

ぐ巨炮叔叔 提交于 2021-01-28 05:12:30
问题 how do I import oracle table function as physical table in Oracle BI EE ? Let's say it is select * from scheme.table_function1(adate) What is correct syntaxis for setting it as BI physical table? How do I specify input parameter (adate)? 回答1: Create a new physical table manually in the repository, set the table type to "Select" and include your sql query. Are you using a repository variable as input parameter? Assuming ADATE is a repository string variable, the syntax would be select * from

Lazy fetching in MyBatis

一笑奈何 提交于 2020-01-16 19:34:06
问题 I couldn't able to find how to achieve lazy loading(even in MyBatis docs). My mapper xml is shown below: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.example.FooMyBatisLazyFetch"> <select id="callFooProc" parameterType="com.example.FooProcBundle" statementType="CALLABLE"> {call FooProc( #{arg1, jdbcType=VARCHAR, mode=IN}, #{arg2, jdbcType=VARCHAR, mode=IN}, #{arg3,

ORA-22905: cannot access rows from a non-nested table item

一个人想着一个人 提交于 2019-12-25 08:26:32
问题 CREATE OR REPLACE TYPE myObjectFormat AS OBJECT ( A VARCHAR2(200), B INTEGER, C INTEGER ) / CREATE OR REPLACE TYPE myTableType AS TABLE OF myObjectFormat ; / CREATE OR REPLACE PACKAGE demo4 AS FUNCTION f1(p_abc_tab IN myTableType) RETURN myTableType PIPELINED; END; / CREATE OR REPLACE PACKAGE BODY demo4 AS FUNCTION f1(p_abc_tab IN myTableType) RETURN myTableType PIPELINED IS BEGIN FOR i in p_abc_tab.first .. p_abc_tab.last LOOP PIPE ROW (myObjectFormat(p_abc_tab(i).a,p_abc_tab(i).b,p_abc_tab

Oracle Pipelined function

爷,独闯天下 提交于 2019-12-23 15:57:54
问题 I'm trying to create a function which returns an object that can be used in the FROM Clause. According to research on the oracle documentation I've found that a PIPELINED function is what I need. I have this code: CREATE TYPE type_struct AS OBJECT ( i NUMBER ); CREATE TYPE tp_struct AS TABLE OF type_struct; CREATE OR REPLACE FUNCTION gen_nums (na NUMBER, nb NUMBER) RETURN tp_struct PIPELINED IS rec type_struct; counter NUMBER; BEGIN counter := na; WHILE (counter <= nb) LOOP SELECT counter

Nested PIPELINED function

偶尔善良 提交于 2019-12-12 03:17:23
问题 create type data_type_1 as object (x number, y number) / create type table_type_1 as table of data_type_1 / create or replace package xyz AS function main_xyz return table_type_1 pipelined; function sub_func return table_type_1 pipelined; function sub_func1 return table_type_1 pipelined; end xyz; / create package body XYZ AS function main_xyz return data_type_1 pipelined is begin --code --pipe row(sub_func); --edit_1 FOR rec in (select * from table(sub_func1(x,y))) LOOP pipe row(rec); END

Want to Wrap PSList in a Powershell function to use pipeline values

馋奶兔 提交于 2019-12-08 03:31:07
问题 I like PSList, and use the CPU and Elapsed times to indentify processes that need to be killed. I would like to wrap it in a powershell function that returns pipeline values so that I could do something like the following: get-remoteprocess server1 | where {$_.CPUMinutes -gt 4} I get stuck in returning values from the function - which I understand would need to be an array of objects. Heres what my first version looks like: function get-remoteproc { param ($hostname) $results = pslist "\\

Is using a SELECT inside a pipelined PL/SQL table function allowed?

别来无恙 提交于 2019-12-08 02:21:34
问题 The docs for pipelined functions say that DML is not allowed when they are used in a SQL statement (typically a SELECT ), and in most examples the pipelined functions are used for data generation or transformation (accepting a custor as parameter), but not issuing any DML statements. Now, technically, it is possible to use SELECTs without any error from Oracle (ORA 14551 will not occur). However, I have experiences reproducible strange behavior of the select; even though PRAGMA AUTONOMOUS

PL/SQL - execute immediate in pipelined function

三世轮回 提交于 2019-12-06 09:11:55
问题 I want to execute dynamic query in my pipelined function and return results of this query. Is it possible to do this? Pipelined function is convenient for me to achieve good interface for my application cause it behaves like a table. The function: CREATE OR REPLACE FUNCTION MyFunction(p_schema VARCHAR2) RETURN MyTableType Pipelined IS v_query VARCHAR2(1000); BEGIN v_query := 'SELECT * FROM TABLE ('||p_schema||'.somepackage.SomeFunction)'; --SomeFunction is another pipelined function EXECUTE

SELECT * FROM TABLE(pipelined function): can I be sure of the order of the rows in the result?

不想你离开。 提交于 2019-12-06 04:20:16
问题 In the following example, will I always get “1, 2”, or is it possible to get “2, 1” and can you tell me where in the documentation you see that guarantee if it exists? If the answer is yes, it means that without ORDER BY nor ORDER SIBLINGS there is a way to be sure of the result set order in a SELECT statement. CREATE TYPE temp_row IS OBJECT(x number); / CREATE TYPE temp_table IS TABLE OF temp_row; / CREATE FUNCTION temp_func RETURN temp_table PIPELINED IS BEGIN PIPE ROW(temp_row(1)); PIPE

SELECT * FROM TABLE(pipelined function): can I be sure of the order of the rows in the result?

丶灬走出姿态 提交于 2019-12-04 08:58:00
In the following example, will I always get “1, 2”, or is it possible to get “2, 1” and can you tell me where in the documentation you see that guarantee if it exists? If the answer is yes, it means that without ORDER BY nor ORDER SIBLINGS there is a way to be sure of the result set order in a SELECT statement. CREATE TYPE temp_row IS OBJECT(x number); / CREATE TYPE temp_table IS TABLE OF temp_row; / CREATE FUNCTION temp_func RETURN temp_table PIPELINED IS BEGIN PIPE ROW(temp_row(1)); PIPE ROW(temp_row(2)); END; / SELECT * FROM table(temp_func()); Thank you. I don't think that there's anywhere