|
|
|
Re: Cannot call a function when creating a dataset [message #658806 is a reply to message #658777] |
Wed, 09 March 2011 20:39 |
|
Here is what I did some time back. I haven't checked to see if it still works:
PROC DEFINITION:
create or replace package status_report AS
type t_cursor is REF CURSOR;
procedure get_statuses(io_cursor IN OUT t_cursor);
END status_report;
/
create or replace package body status_report as
procedure get_statuses(io_cursor IN OUT t_cursor)
IS
v_cursor t_cursor;
BEGIN
OPEN v_cursor FOR
SELECT name, id, description, is_active, is_default, status_type
FROM status;
io_cursor := v_cursor;
END get_statuses;
END status_report;
/
I'l have to see whether that works in 2.5.0 and Oracle 11.
|
|
|
Re: Cannot call a function when creating a dataset [message #658817 is a reply to message #658777] |
Wed, 09 March 2011 22:20 |
|
I have the following working under BIRT 2.3:
In Oracle:
create or replace package birt_support AS
type t_cursor is REF CURSOR;
END birt_support;
/
create or replace procedure get_stattest( outcursor OUT birt_support.t_cursor )
as
begin
open outcursor for select name, id, description, is_active, is_default, status_type from status;
end get_stattest;
/
In BIRT:
Create a new report with an Oracle datasource pointed to my schema.
Create a dataset of type SQL Stored Procedure Query
For the query, either drag and drop or directly enter:
{call ROME.GET_STATTEST(?)}
If you drag and drop, the parameter should be automatically created. Otherwise you will need to do that yourself. In either case you want to check that you have:
Parameter Name = outcursor
Type = Any
Direction = Output
I'll have to post the XML of my test report separately. You'll have to translate the data connection to your own environment, of course.
|
|
|
Re: Cannot call a function when creating a dataset [message #658818 is a reply to message #658817] |
Wed, 09 March 2011 22:22 |
|
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.16" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 2.3.0.v20080606 Build <2.3.0.v20080618-0630></property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source" id="6">
<property name="odaDriverClass">oracle.jdbc.OracleDriver</property>
<property name="odaURL">jdbc:oracle:thin:@demo17:1521:rome1020a</property >
<property name="odaUser">myschema</property>
<encrypted-property name="odaPassword" encryptionID="base64">cjPtZQ==</encrypted-property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.SPSelectDataSet " name="Data Set" id="7">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">NAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">ID</property>
<property name="dataType">decimal</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">DESCRIPTION</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">IS_ACTIVE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">IS_DEFAULT</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">STATUS_TYPE</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="parameters">
<structure>
<property name="name">OUTCURSOR</property>
<property name="nativeName">OUTCURSOR</property>
<property name="nativeDataType">-10</property>
<property name="position">1</property>
<property name="allowNull">true</property>
<property name="isOutput">true</property>
</structure>
</list-property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">NAME</property>
<property name="nativeName">NAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">ID</property>
<property name="nativeName">ID</property>
<property name="dataType">decimal</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">DESCRIPTION</property>
<property name="nativeName">DESCRIPTION</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">IS_ACTIVE</property>
<property name="nativeName">IS_ACTIVE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">IS_DEFAULT</property>
<property name="nativeName">IS_DEFAULT</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">STATUS_TYPE</property>
<property name="nativeName">STATUS_TYPE</property>
<property name="dataType">string</property>
</structure>
</list-property>
<property name="queryText">{call MYSCHEMA.GET_STATTEST(?)}</property>
<xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
<Version>1.0</Version>
<design:DataSetParameters>
<design:parameterDefinitions>
<design:inOutMode>Out</design:inOutMode>
<design:attributes>
<design:name>OUTCURSOR</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>-10</design:nativeDataTypeCode>
<design:precision>0</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
</design:parameterDefinitions>
</design:DataSetParameters>
</model:DesignValues>
]]></xml-property>
</oda-data-set>
</data-sets>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="8">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">NAME</property>
<property name="displayName">NAME</property>
<expression name="expression">dataSetRow["NAME"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">ID</property>
<property name="displayName">ID</property>
<expression name="expression">dataSetRow["ID"]</expression>
<property name="dataType">decimal</property>
</structure>
<structure>
<property name="name">DESCRIPTION</property>
<property name="displayName">DESCRIPTION</property>
<expression name="expression">dataSetRow["DESCRIPTION"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">IS_ACTIVE</property>
<property name="displayName">IS_ACTIVE</property>
<expression name="expression">dataSetRow["IS_ACTIVE"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">IS_DEFAULT</property>
<property name="displayName">IS_DEFAULT</property>
<expression name="expression">dataSetRow["IS_DEFAULT"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">STATUS_TYPE</property>
<property name="displayName">STATUS_TYPE</property>
<expression name="expression">dataSetRow["STATUS_TYPE"]</expression >
<property name="dataType">string</property>
</structure>
</list-property>
<column id="42"/>
<column id="43"/>
<column id="44"/>
<column id="45"/>
<column id="46"/>
<column id="47"/>
<header>
<row id="9">
<cell id="10">
<label id="11">
<text-property name="text">NAME</text-property>
</label>
</cell>
<cell id="12">
<label id="13">
<text-property name="text">ID</text-property>
</label>
</cell>
<cell id="14">
<label id="15">
<text-property name="text">DESCRIPTION</text-property>
</label>
</cell>
<cell id="16">
<label id="17">
<text-property name="text">IS_ACTIVE</text-property>
</label>
</cell>
<cell id="18">
<label id="19">
<text-property name="text">IS_DEFAULT</text-property>
</label>
</cell>
<cell id="20">
<label id="21">
<text-property name="text">STATUS_TYPE</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="22">
<cell id="23">
<data id="24">
<property name="resultSetColumn">NAME</property>
</data>
</cell>
<cell id="25">
<data id="26">
<property name="resultSetColumn">ID</property>
</data>
</cell>
<cell id="27">
<data id="28">
<property name="resultSetColumn">DESCRIPTION</property>
</data>
</cell>
<cell id="29">
<data id="30">
<property name="resultSetColumn">IS_ACTIVE</property>
</data>
</cell>
<cell id="31">
<data id="32">
<property name="resultSetColumn">IS_DEFAULT</property>
</data>
</cell>
<cell id="33">
<data id="34">
<property name="resultSetColumn">STATUS_TYPE</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="35">
<cell id="36"/>
<cell id="37"/>
<cell id="38"/>
<cell id="39"/>
<cell id="40"/>
<cell id="41"/>
</row>
</footer>
</table>
</body>
</report>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03802 seconds