Report cannot access pl/sql table variable defined in Package Spec.

Hi,
I've created a package spec called pkg_report with a PL/SQL table variable defined called body_text_table. When I tried to compile the following code under the Before Report trigger:
:desc := pkg_report.body_text_table(1);
Oracle gave me the following error:
Implementation Restriction: 'PKG_REPORT.BODY_TEXT_TABLE': Cannot directly access remote package variable or cursor.
Does anyone have any idea about this error? Thank you for your time at looking at it.
Regards,
John

You cannot directly access the package variable in a database package. The work around is to create a set_variable and get_variable wrapper function in the package body. See Metalink note 105838.1 for more info.
A simple example:
create or replace package my_package as
  my_var     number;
  function   get_variable return number ;
  procedure  set_variable (p_value in number) ;
end ;
create or replace package body my_package as
  function get_variable return number is
  begin
    return my_var;
  end ;
  procedure set_variable(p_value in number) is
  begin
    my_var := p_value ;
  end ;
end;

Similar Messages

  • Can I use Reports Server Queue PL/SQL Table API to retrieve past jobs ?

    Hi all,
    Can I use Reports Server Queue PL/SQL Table API to retrieve past jobs using WEB.SHOW_DOCUMENT from Forms ?
    I have reviewed note 72531.1 about using this feature and wonder if i can use this metadata to retrieve past jobs submitted by a user.
    The idea would be to have a form module that can filter data from the rw_server_queue table, say, base on user running the form, and be able to retrieve past jobs from Report Server Queue. For this, one would query this table and use WEB.SHOW_DOCUMENT.
    Is this possible ...?
    Regards, Luis ...!

    Based on that metalink note and the code in the script rw_server.sql, I am pretty sure that by querying the table you would be able accomplish what you want... I have not tested it myself... but it looks that it will work... you have the jobid available from the queue, so you can use web.show_document to retrieve the output previously generated...
    ref:
    -- Constants for p_status_code and status_code in rw_server_queue table (same as zrcct_jstype)
    UNKNOWN CONSTANT NUMBER(2) := 0; -- no such job
    ENQUEUED CONSTANT NUMBER(2) := 1; -- job is waiting in queue
    OPENING CONSTANT NUMBER(2) := 2; -- opening report
    RUNNING CONSTANT NUMBER(2) := 3; -- running report
    FINISHED          CONSTANT NUMBER(2) := 4; -- job has finished
    TERMINATED_W_ERR CONSTANT NUMBER(2) := 5; -- job has terminated with

  • Accessing PL/SQL table in SQL query

    Hello,
    Is it possible to use plain SQL to query PL/SQL table? In my case this table is returned by UTL_HTTP.REQUEST_PIECES function, which is defined as:
    create or replace package utl_http is
    type html_pieces is table of varchar2(2000) index by binary_integer;
    function request_pieces (url in varchar2,
    max_pieces natural default 32767)
    return html_pieces;
    pragma restrict_references (request_pieces, wnds, rnds, wnps, rnps);
    Generally, I want to access chunks of external data for comparison without using PL/SQL. Thanks ahead for ideas. Ideally, I need working example because my attempts to use TABLE & CAST failed.

    I was going to suggest you could try and create your own wrapper around utl_http and use a database type, but then I remembered this excellent thread which covers it better than I ever could - Billy, hope you don't mind passing on your good work!
    Re: Error using UTL_HTTP over HTTPS

  • Non-admin user cannot access Essbase server level variables

    Version 11.1.1.3
    Essbase Substitution variables are created at server level. Users are getting error in FR report that uses the Subsitution Variable -- Essbase Error(1051085): You do not have sufficient access to get this substitution variable. Also, users cannot access Substitution variable in SmartView. However, users can access variables created at database level. Users are provisioned as "Server Access" to Essbase and filter access to ASO application "MGTRPTG", where MGTRPTG is an ASO essbase application for reporting. We tried the same provisioning in two other environments and it seems to be working fine.
    User is type "Essbase and Planning" provisioned with essbase "server access", application mgtrptg "filter", Reporting and Analysis "analyst", "dynamic viewer" and "Explorer". In addition, it is given a filter "REP_DME_GALB" which restricts 2 dimensions (Division and Geography).
    Steps taken to resolve:
    1. Existing users were deprovisioned and reprovisioned with no effect.
    2. Created brand new identically provisioned users in Prod and QA. QA user can access the server level var and Prod user cannot
    3. Created a brand new server level variable in Prod and this cannot be accessed.
    4. All services have already been restarted several times.
    5. SR has been opened.
    Temporary workaround:
    By creating a duplicate of the same set of variables at the database level, the reports work. This can only be a temporary workaround as the client cannot be expected to maintain two sets of substitution variables since there are 3 applications using these server level variables.
    Thank you for any ideas!
    Jennifer

    You have stumbled on a defect which is resolved in the Hyperion Planning 9.3.1 patch 6 and above. If you have your planning preferences set to indent members it will cause forms which have page selections to show as invalid in SmartView.
    You can either patch Planning or turn off the preference. The patches are available from http://metalink3.oracle.com and require account which has been associated with your client ID.
    P.S. Usually it's not a good practice to use the admin id.
    Regards,
    -John
    Edited by: Jbooth on Nov 3, 2008 2:12 PM

  • ADF Report output from PL\SQL Table

    Hi,
    I am some complex calcualtions in the report and the report has a fixed number of columns and reports. Is there any way i can do all the programming in pl\sql and call this procedure/package from ADF and return the pl\sql table type?
    Can i create a VO from pl\sql table?
    Thanks,
    Lakshmi.

    On Database
    create or replace type empRow as object (
    Employee_ID Number,
    First_Name Varchar2(20),
    Last_name Varchar2(25)
    create or replace type empTable as table of empRow;
    create or replace function getEmployees
    (aDepartmentID Number)
    return empTable
    PIPELINED
    as
    begin
    for rec in (select Employee_ID, First_Name, Last_name
    from employees
    where Department_ID = aDepartmentID) loop
    pipe row(new empRow(rec.Employee_ID, rec.First_Name, rec.Last_name));
    end loop;
    return;
    end;
    THEN create a VO based on this Query below:
    select * from table(getEmployees(:deptid)
    and you are ready to Go.

  • How to use the Table Function defined  in package in OWB?

    Hi,
    I defined a table function in a package. I am trying to use that in owb using Table function operator. But I came to know that, owb R1 supports only standalone table functions.
    Is there any other way to use the table function defined in a package. As like we create synonyms for functions, is there any other way to do this.
    I tryed to create synonyms, it is created. But it is showing compilation error. Finally I found that, we can't create synonyms for functions which are defined in packages.
    Any one can explain it, how to resolve this problem.
    Thank you,
    Regards
    Gowtham Sen.

    Hi Marcos,
    Thank you for reply.
    OWB R1 supports stand alone table functions. Here what I mean is, the table fucntion which is not inculded in any package is a stand alone table function.
    for example say sample_tbl_fn is a table function. It is defined as a function.It is a stand alone function. We call this fucntion as "samp_tbl_fn()";
    For exampe say sample_pkg is a package. say a function is defined in a package.
    then we call that function as sample_pkg.functionname(); This is not a stand alone function.
    I hope you understand it.
    owb supports stand alone functions.
    Here I would like to know, is there any other way to use the functions which are defined in package. While I am trying to use those functions (which are defined in package -- giving the name as packagename.functionname) it is throwing an error "Invalid object name."
    Here I would like know, is there any other way to use the table functions which are defined in a package.
    Thank you,
    Regards,
    Gowtham Sen.

  • Report Conversion - Access to SQL

    How do I convert crystal reports written for Access to work with SQL?

    I have successfully converted most reports to connect to the SQL database.
    I have a problem with the prompt screen in one report.  The data prompt screen will appear in Crystal, but will not appear  when selecting that report in my application.  Instead the report populates with the last saved data in Crystal.
    is this a report problem or a problem with the viewer in my application?
    Thanks
    Luke

  • Error while retrieving data from PL/SQL Table using SELECT st. (Urgent!!!)

    Hi Friends,
    I am using Oracle 8.1.6 Server, & facing problems while retrieving data from a PL/SQL Table:
    CREATE or REPLACE PROCEDURE test_proc IS
    TYPE tP2 is TABLE of varchar2(10); --declared a collection
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST(dt2 as tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    While executing the above procedure, I encountered foll. error:
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [],
    ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [], [], [], [], []
    ORA-06553: PLS-801: internal error [0]
    Can anyone please help me, where the problem is??
    Is it Possible to retrieve data from PL/SQL TABLE using SELECT statement? & How ?
    Thanks in advance.
    Best Regards,
    Jay Raval.

    Thanks Roger for the Update.
    It means that have to first CREATE TYPE .. TABLE in database then only I can fire a Select statement on that TYPE.
    Actually I wanted to fire a Select statement on the TABLE TYPE, defined & declared in PLSQL stored procedure using DECLARE TYPE .. TABLE & not using CREATE TYPE .. TABLE.
    I was eager to know this, because my organization is reluctant in using CREATE TYPE .. TABLE defined in the database, so I was looking out for another alternative to access PL/SQL TABLE using Select statement without defining it database. It would have been good if I could access a PLSQL TABLE using Select statement Declared locally in the stored procedure.
    Can I summarize that to access a PL/SQL TABLE using SELECT statement, I have to first CREATE TYPE .. TABLE?
    If someone have any other idea on this, please do let me know.
    Thanks a lot for all help.
    Best Regards,
    Jay Raval.
    You have to define a database type...
    create type tP2 is table of varchar2(10)
    CREATE OR REPLACE PROCEDURE TEST_PROC
    IS
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST (dt2 AS tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    This will work.
    Roger

  • Using Table Variables MSSQL with xMII 11.5

    I was trying an experiment with a query today where instead of creating a temp table in SQL, I used the T-SQL table variable.  For a simple example: 
    DECLARE @ProductTotals TABLE
    (  ProductID int,   Revenue money)
    INSERT INTO @ProductTotals (ProductID, Revenue)
    SELECT ProductID, SUM(UnitPrice * Quantity)
    FROM [Order Details]
    GROUP BY ProductID
    SELECT *
    FROM  @ProductTotals
    Well, this works fine in SQL Query Analyzer , but not in xMII.  I get a message that says "no results returned from this query"    So you ask, "why not just use a temp table"  Well on the real application, the query can take up to 30 seconds to run, and I have the chance of having multiple users execute the same query in that time, in which my temp table will get stomped on creating an error.  So I thought of using table variables as a possible alternative to avoid this.  
    I have already figured a work around, I put this code into a stored procedure and call that.  I could also do a similar workaround using separate queries / BLS.  However, I'm curious why xMII wouldn't execute this in the first place, being that it worked fine in Query Analyzer against the exact same database.

    Doug,
    I tried on my box with the "sqljdbc.jar" from 11.08.2006 (German Dateformat dd.MM.yyyy) and works also.
    For my test I had using the following SQL-Statement:
    DECLARE @ProductTotals TABLE
    ( ProductCount int, ProductID int, Revenue money)
    INSERT @ProductTotals
    SELECT count(O.ProductID) as ProductCount, P.ProductID, SUM(O.UnitPrice * O.Quantity)
    FROM [Order Details] O
    INNER JOIN Products P
    ON O.ProductID = P.ProductID
    GROUP BY P.ProductID
    SELECT *
    FROM @ProductTotals
    Did you get a result back in MII only for the SELECT statement
    SELECT count(O.ProductID) as ProductCount, P.ProductID, SUM(O.UnitPrice * O.Quantity)
    FROM [Order Details] O
    INNER JOIN Products P
    ON O.ProductID = P.ProductID
    GROUP BY P.ProductID
    ? My opinion is, that your select brings nothing back.
    Regards
    Pedro

  • How to invoke PL/SQL Table parameter in the query string?

    Hello,
    I've met a problem invoking PL/SQL Table parameter in the query string, in OWS 3.0.
    What I'm going to do is, to invoke a stored procedure to generate a web page using PL/SQL Web Toolkit 2.0, like: "http://.../owa/test_proc".
    But there is a IN parameter for this procedure, and it's a PL/SQL Table variable. So I can't invoke the procedure sucessfully just using "http://.../owa/test_proc?v_plsql=i_plsql".
    Did someone have met this kind of problem or have the answer to it? Thanks so much for your help.

    When using procedures with pl/sql-tables as parameter they should be overloaded, e.g.:
    procedure my_procedure (my_var in varchar2)...
    and
    procedure my_procedure (my_var in owa_util.ident_arr)
    the procedure then can be called with:
    http://..../my_procedure?my_var=Scott, which invokes the version with the varchar2 parameter, or
    http://..../my_procedure?my_var=Scott&my_var=Miller......
    which invokes the version with the pl/sql-Table
    Another solution might be the use of flexible parameters, passing pairs of parameter_name, parameter_value to your procedure. Your procedure looks like:
    procedure my_procedure (name_array IN owa.vc_arr, value_array IN owa.vc_arr)..
    and is invoked (note the ! )
    http://..../!my_procedure?ename=Scott&sal=200&job=clerk.....
    looping through the pl/sql tables will retrieve values of ename, sal and job for name_array and Scott, 200 and clerk for value_array
    Hth
    null

  • Oracle Pl/Sql table question..

    Hi guys,
    I have an Oracle PL/SQL question. I don't
    know which board can i ask it. This is why
    i am asking here.
    I declare a PL/SQL table(traditional array),
    and populate it in a session. Another user logged on with another session and wanted to access this PL/SQL table data, But He/she received "No Data Found".
    Is the PL/SQL table session scope?
    Pl/Sql table declared in Package Spec
    and the procedures to populate and
    access the data in/from this Pl/Sql table
    are coded in package body.
    Thanks...Ali
    null

    Hi guys,
    I have an Oracle PL/SQL question. I don't
    know which board can i ask it. This is why
    i am asking here.
    I declare a PL/SQL table(traditional array),
    and populate it in a session. Another user logged on with another session and wanted to access this PL/SQL table data, But He/she received "No Data Found".
    Is the PL/SQL table session scope?
    Pl/Sql table declared in Package Spec
    and the procedures to populate and
    access the data in/from this Pl/Sql table
    are coded in package body.
    Thanks...Ali
    null

  • Pl sql tables to VB

    Hi all,
    We have ORACLE 7.3 as server and VB 6.0 as the client . We have a procedure that returns PL/SQL table as an out parameter.When the procedure returns a single dimensional PL/SQL table , the front end does not have any problem in getting the output. When the same package tries to return a multidemensioanl PL/SQL table to front end we get an error message in the front end saying that the provider does not support PL/SQL tables or records.The package creates the PL/SQL table as follows
    TYPE emp_inf is RECORD
    (empno varchar2(7),
    ename varchar2(50));
    TYPE emp_inf_table is table of emp_inf
    INDEX BY BINARY_INTEGER;
    The procedure works fine on the server side.Any ideas why we are getting that error message. We are using ADO in the front end. Any other way of doing the above.
    Thanks in advance,
    Jay.

    direct vb questions which use the odbc driver to the odbc forum.
    you might get an answer there.

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

    Oracle error ORA-22905: cannot access rows from a non-nested table item
    Creating a report using oracle plsql code .
    Getting error ;
    Oracle error ORA-22905: cannot access rows from a non-nested table item
    when I am trying to pass data in clause in pl sql proc
    basically I have a proc which takes 2 parameters(a and b)
    proc (
    P_a varchar2,
    p_b varchar2,
    OUT SYS_REFCURSOR
    culprit code which is giving me  the error and on google they say cast it but I dont know how to do it in my context
    --where  id in (
    --        SELECT * FROM THE (SELECT p_cd_common.get_table_from_string(P_a) FROM dual)
    --        union
    --        SELECT * FROM THE (SELECT p_cd_common.get_table_from_string(P_b) FROM dual)
    data sample returned from this :SELECT * FROM THE (SELECT p_cd_common.get_table_from_string(P_a) FROM dual)
    'Abc','def',
    data sample returned from this;SELECT * FROM THE (SELECT p_cd_common.get_table_from_string(P_b) FROM dual)
    'fgd','fth',
    Any answers ?
    How to pass data in clause in a better way

    Why are you creating a duplicate post? I already asked you to post p_cd_common.get_table_from_string. In particular what is function return type and where it is declared. As I already mentioned, most likely function return type is declared in the package and therefore is PL/SQL type. And TABLE operator can only work with SQL types.
    SY.

  • PL/SQL in user defined reports

    Is it possible to use PL/SQL in user defined reports? As far as I know, it isn't, but...
    And one more question: can we do something like this in user defined reports:
    ' select * from :TABLE '
    where
    :TABLE is a bind variable?
    Thanks in advance
    Aliq

    I want to create a parent-child report, which in simply version does three things:
    parent
    1. takes all the table names from user_tables
    2. for each table_name (taken from user_tables) it takes a few rows from this table (selet A,B,C from table_name).
    child
    3. for each table name (from master) gives additional information from this table (select D,E,F from table_name)
    And I wonder if it's possible.

  • User cannot access Crystal reports after user was deleted and recreated

    We are using Crystal Enterprise XIr2.  We are using Windows AD authentication.  We had an issue with a user where they were deleted in Active Directory.  Now they can no longer run Crystal reports.  When I go into the CMC and open users I see this user.  When I try to open this user I get the following error
    There was an error while retrieving data from the server: Active Directory Authentication failed to get the Active Directory groups for the account with ID "8B003DF11D45B244AC3B61AB36B6C445:ALLENDG". Please make sure this account is valid and belongs to an accessible domain.
    I think Crystal is still trying to access the user's old Active Directory account.
    I cannot delete the user either in CMC.
    Is there someway I can correct this user.
    Thanks
    Adam

    Arjun - Thank you for your help.  I looked in Central Management Console but I could not find what you indicated.
    CMC--> Public Folder --> Administration Tools
    In administration tool, there are two objects
    1) Update Windows AD Group Graph
    2) Update Windows AD Group Graph and Aliases --> Right click on this Report and click on RUN Now.
    I ended up deleting the records for this user in these SQL tables and then user could access InfoView
    CMS_Aliases5 (2 records for this user)
    CMS_InfoObjects5 (1 record with both aliases)

Maybe you are looking for

  • Can not update ipod ios

    I can not update my ipod touch....its model is 4.3.5.(8L1)... i tried to update on i tunes...everytime for 70 minutes it loads and loads and at the end itt gives error...and can not load the update....so icant update to ios 5...is there an other way

  • Music player in Flash...

    Hi, I am looking to replicate the way the music tracks are presented on this website: http://joelocke.com/music.htm I'd like to create something somewhat similar, in which I can simply type out the name of each track and then have the small Play/Paus

  • Help racecar game problem

    im really not that good at java and this may just be a simple structure problem or there may be no way to do what i want but i thought id just make sure before i proceed and do it another less organised way im making a top down veiw car racing game w

  • My attachments are blank!

    why won't my adobe reader (10.1.4) read doc.x attachments?

  • Why do I have so much trouble with arrays

    using the following query: <cfloop index="loopCompanyNumberSet01Array" from="1" to="#arrayLen(companyNumberSet01Array)#" step="1"> <cfquery name="qrySeriesList" datasource="erpdb01"> SELECT DISTINCT Left(t_item,2) FROM dbo.ttiitm001#companyNumberSet0