I cant call a procedure within a data template

Hi,
I m working in a data template because i want to call a prcedure befor running the report.
My procedure is under the folder of procedure. it is not under a package.
So i left the defaultpackage empty in the data model.
*<dataTemplate name="Extraction_Template" dataSourceRef="mydatasource" defaultPackage="">*
But it didsn't work.
Help.
SAAD

The default package attribute is required if your data template contains any other calls to PL/SQL. For the source attribute for the data trigger definition, you need to have the source in the form of <package name>.<function name>
Check out the report designer's guide for details.
Thanks,
BIPuser

Similar Messages

  • Function call in procedure within Package Body

    I am a novice in PL/SQL so that I can't find out where the problem is. I am testing a function call in procedure within a Package Body.
    But the PL/SQL Complier doesn't compile the package body but I don't know what I do wrong. Plz let me know how to call a function in procedure within a Package Body?
    Here are the Packaget test programs..
    CREATE OR REPLACE PACKAGE manage_students
    IS
    PROCEDURE find_sname;
    PROCEDURE find_test;
    PROCEDURE find_test_called;
    FUNCTION GET_LASTMT
    RETURN SEQUENCE_TEST.SEQ_NO%TYPE;
    END manage_students;
    CREATE OR REPLACE PACKAGE BODY manage_students AS
    v_max_nbr SEQUENCE_TEST.SEQ_NO%TYPE;
    PROCEDURE find_sname
    IS
    BEGIN
    BEGIN
    SELECT MAX(SEQ_NO)
    INTO v_max_nbr
    from SEQUENCE_TEST;
    DBMS_OUTPUT.PUT_LINE('MAX NUMBER is : '||v_max_nbr);
    EXCEPTION
    WHEN OTHERS
    THEN DBMS_OUTPUT.PUT_LINE('Error in finding student_id: ');
    RETURN;
    END;
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN DBMS_OUTPUT.PUT_LINE('Error in finding student_id: ');
    END find_sname;
    PROCEDURE find_test
    IS
    BEGIN
    BEGIN
    DBMS_OUTPUT.PUT_LINE('MAX NUMBER Called from another procedure : '||v_max_nbr);
    EXCEPTION
    WHEN OTHERS
    THEN DBMS_OUTPUT.PUT_LINE('Error in finding student_id: ');
    RETURN;
    END;
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN DBMS_OUTPUT.PUT_LINE('Error in finding student_id: ');
    END find_test;
    FUNCTION GET_LASTMT
    RETURN SEQUENCE_TEST.SEQ_NO%TYPE
    IS
    v_max_nbr SEQUENCE_TEST.SEQ_NO%TYPE;
    BEGIN
    SELECT MAX(SEQ_NO)
    INTO v_max_nbr
    from SEQUENCE_TEST;
    RETURN v_max_nbr;
    EXCEPTION
    WHEN OTHERS
    THEN
    DECLARE
    v_sqlerrm VARCHAR2(250) :=
    SUBSTR(SQLERRM,1,250);
    BEGIN
    RAISE_APPLICATION_ERROR(-20003,
    'Error in instructor_id: '||v_sqlerrm);
    END;
    END GET_LASTMT;
    PROCEDURE find_test_called
    IS
    BEGIN
    BEGIN
    V_max := Manage_students.GET_LASTMT;
    DBMS_OUTPUT.PUT_LINE('MAX_NUMBER :'|| V_max);
    EXCEPTION
    WHEN OTHERS
    THEN DBMS_OUTPUT.PUT_LINE('Error in finding student_id: ');
    RETURN NULL;
    END;
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN DBMS_OUTPUT.PUT_LINE('Error in finding student_id: ');
    END find_test_called;
    END manage_students;
    DECLARE
    v_max SEQUENCE_TEST.SEQ_NO%TYPE;
    BEGIN
    manage_students.find_sname;
    DBMS_OUTPUT.PUT_LINE ('Student ID: Execute.');
    manage_students.find_test;
    manage_students.find_test_called;
    END;
    -----------------------------------------------------------------------------------------------

    Hi,
    Welcome to the forum!
    You'll find that there are a lot of people willing to help you.
    Are you willing to help them? Whenever you have a problem, post enough for people to re-create the problem themselves. That includes CREATE TABLE and INSERT statements for all the tables you use.
    Error messages are very helpful. Post the complete error message you're getting, including line number. (It looks like your EXCEPTION sections aren't doing much, except hiding the real errors. That's a bad programming practice, but probably not causing your present problem - just a future one.)
    Never post unformatted code. Indent the code to show the extent of each procedure, and the blocks within each one.
    When posting formatted text on this site, type these 6 characters:
    \(all small letters, inside curly brackets) before and after each section of formatted test, to preserve the spacing.
    For example, the procedure find_test_called would be a lot easier to read like this:PROCEDURE find_test_called
    IS
    BEGIN
         BEGIN
              V_max := Manage_students.GET_LASTMT;
              DBMS_OUTPUT.PUT_LINE ('MAX_NUMBER :' || V_max);
         EXCEPTION
              WHEN OTHERS
              THEN
                   DBMS_OUTPUT.PUT_LINE ('Error in finding student_id: ');
                   RETURN      NULL;
         END;
         COMMIT;
    EXCEPTION
         WHEN OTHERS
         THEN
              DBMS_OUTPUT.PUT_LINE ('Error in finding student_id: ');
    END find_test_called;
    It's much easier to tell from the code above that you're trying to return NULL from a procedure.  Only functions can return anything (counting NULL); procedures can have RETURN statements, but that single word"RETURN;" is the entire statement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Call a procedure within a Procedure

    hi
    How can i call a procedure within a procedure
    Thanks in advance

    SQL> create procedure b as
      2  begin
      3  null;
      4  end;
      5  /
    Procedure created.
    SQL> create procedure a as
      2  begin
      3  b;
      4  end;
      5  /
    Procedure created.
    SQL>

  • Dynamic Page that calls DB procedure to update data gets PLS222 or PLS306

    This seems a bit odd to me: I'm getting either "procedure no in scope" (when I call a procedure with the right args) or "wrong # or type of arguments" (when I call it with the wrong ones, so it is checking the procedure) in a dynamic page.<P>
    I'm trying to build a dynamic page that will display data and checkboxes (basically to get around the multi-select limitations -- management has told me that the "fake" md form is not acceptable)<P>
    So I build the page, it displays the data just fine exactly as we want it to:<P>
    <HTML><FORM><ORACLE>declare
    p_mdoc_user portal.wwv_utl_api_types.vc_arr;
    p_mdoc_user_seq portal.wwv_utl_api_types.vc_arr;
    p_seg_id portal.wwv_utl_api_types.vc_arr;
    p_cb portal.wwv_utl_api_types.vc_arr;
    p_action varchar2(20):='Save Changes';
    begin
    htp.p('Select your segments');
    htp.p('< p>');
    htp.p('<table border=2 cellpadding=2 cellspacing=0>');
    htp.tablerowopen;
    htp.tableheader('Seg#');
    htp.tableheader('Included');
    htp.tablerowclose;
    for r1 in (select seg_id, build_seg
    from web.mdoc_create_seg
    where mdoc_user = :mdoc_user
    and mdoc_user_seq = :mdoc_user_seq)
    loop
    htp.p('<input_type="hidden" name="p_mdoc_user" value='||:mdoc_user||'>');
    htp.p('<input_type="hidden" name="p_mdoc_user_seq" value='||:mdoc_user_seq||'>');
    htp.p('<input_type="hidden" name="p_seg_id" value='||to_char(r1.seg_id)||'>');
    htp.p('<tr><td>');
    htp.p(r1.seg_id);
    htp.p('</td><td>');
    if r1.build_seg='TRUE' then
    htp.p('<input type="checkbox" name="p_cb" value="Y" checked>');
    else
    htp.p('<input type="checkbox" name="p_cb" value="Y">');
    end if;
    htp.p('</td></tr>');
    end loop;
    htp.p('</table>');
    htp.p('< p>');
    /*note, this is where I'm putting in a procedure call to update*/
    end;
    </ORACLE></FORM></HTML><P>
    so then I try to add the procedure call (where the sql*plus comment is above)<P>
    htp.p('<input type="button" value="Save Changes" onclick='||
    mdoc_seg_create_choice_p(
    p_mdoc_user,
    p_mdoc_user_seq,
    p_seg_id,
    p_cb)
    ||'>');<P>
    When I try to run as portlet, I get pls 222 not in scope. <but>
    When I take a value out (say remove the last ",p_cb") - I get pls 306 wrong number or type of args to call.<P>
    I've granted the procedure and its underlying tables to portal/public/and portal_public, even though I'm building the dynamic page under a DB provider that is the same as the schema I wrote the procedure in.<P>
    I've tried specifying the schema, using a public synonym, and putting it in a package: same thing occurs, either I get pls 00222 not in scope when I call it with the right columns, or if I purposefully leave one out I get PLS 00306 wrong # or type of args.<P>
    Any ideas?
    -Mike

    Hi guys
    Check out the last 2 posts in this thread for ideas on how to implement 1.
    Report on user data from LDAP
    Varad

  • Calling Stored Procedure with a DATE input parameter

    Hi. A question about Date input parameters when calling a stored procedure...
    I have a procedure that takes a DATE parameter as input. I would like that DATE value to include a Time element.
    My Application Module method takes an input parameter as java.util.Date (myParamDate) - which will preserve a time element(?).
    However when I create the CallableStatement, I'm trying to set the parameter using setDate like this (for param 5):
                st = getDBTransaction().createCallableStatement("begin cs_my_pck.request_values(?,?,?,?,?,?,?,?); end;", 0);           
                Connection myConn = st.getConnection();
                ArrayDescriptor myArrDesc  =  ArrayDescriptor.createDescriptor("CS_FIELD_TABT", myConn);
                Array sqlParamNameArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramNames.toArray());
                Array sqlParamValueArray = new oracle.sql.ARRAY(myArrDesc, myConn, paramValues.toArray());
                Array sqlFilterNameArray = new oracle.sql.ARRAY(myArrDesc,myConn,filterNames.toArray());
                st.setString(1, repType);
                st.setObject(2, sqlParamNameArray);
                st.setObject(3,sqlParamValueArray);
                st.setObject(4,sqlFilterNameArray);
                java.sql.Date myRepDate = new java.sql.Date(myParamDate.getTime());
                st.setDate(5,myRepDate);
                System.out.println("Report Date = " + myRepDate.toString());
                st.setString(6,repUser);
                st.setString(7,repAttach);
                // set out param
                st.registerOutParameter(8, Types.NUMERIC);
                st.execute();I understand java.sql.Date does NOT include a Time element. But setDate() accepts only a java.sql.Date so my procedure parameter ends up with a zero time element.
    How do I call this procedure retaining the Time element?
    Thanks.

    It includes time element, if you want more precision go with timestamp.
    http://docs.oracle.com/javase/6/docs/api/java/sql/Date.html

  • Can we call a procedure within function?

    Can we call a procedure in function?
    If yes, then please explain with example.
    Thanks
    Aman

    Why don't you try it?
    SQL> set serveroutput on
    SQL> declare
      2   procedure p1 (
      3    i1 in out number
      4   )
      5   as
      6   begin
      7    i1 := 200;
      8   end p1;
      9   function f1
    10   return number
    11   is
    12    l1 number;
    13   begin
    14    p1(l1);
    15    return l1;
    16   end f1;
    17  begin
    18   dbms_output.put_line(f1);
    19  end;
    20  /
    200
    PL/SQL procedure successfully completed.
    SQL> set serveroutput off

  • Pl/sql procedure in XML Data Template.

    Hi
    I have a procedure , which is returning a ref cursor , i need to use this ref cursor in xml data templete . how we will write this data templete.
    Also how to call the procedure in data templete.
    Please guide me.
    SS

    If it's function you can call it direct, Procedure all you need to do is to wrap the procedure around a function and call that function which return the ref cursor
    For example :
    I have getdept procedure which has OUT ref cursor, I will wrap this with
    get_dept function which return the ref Cursor then
    <sqlStatement name="Q1">
    <![CDATA[SELECT get_dept(:p1,:p2,....) dept from dual]]>
    </sqlStatement>

  • Call Oracle procedure with custom data type within Java and Hibernate

    I have a custom date TYPE in Oracle
    like
    CREATE TYPE DATEARRAY AS TABLE OF DATE;
    and I have a Oracle function also
    like
    CREATE OR REPLACE FUNCTION doesContain (list DATEARRAY, val VARCHAR2) RETURN NUMBER
    IS
    END doesContain;
    In my Java class,
    I have a collection which contain a list of java.util.Date objects
    When I call Oracle function "doesContain", how to pass my java collection to this Oracle function ...
    anyone can provide solutions?
    Please !!!
    Thanks,
    Pulikkottil

    Vu,
    First of all you need to define your types as database types, for example:
    create or replace type T_ID as table of number(5)Then you need to use the "oracle.sql.ARRAY" class. You can search this forum's archives for the term "ARRAY" in order to find more details and you can also find some samples via the JDBC Web page at the OTN Web site.
    Good Luck,
    Avi.

  • Calling package procedure within another procedure ???

    Hello ,
    I have package called import_pack, within this i have procedure called import_proc. I have another separate procedure called main_proc.
    Now i want to call import_proc in main_proc. how do i do this ???
    Any example would be great. Thank you so much.

    Hi,
    If the import_pack package is in the user_x schema, then the following will always work:
    user_x.import_pack.import_proc (...);If main.proc is also in the user_x schema, then the owner name is optional, so this would be acceptable, too:
    import_pack.import_proc (...);If main_proc is in the same package, then the package name is optional, so this would also work:
    import_proc (...);

  • Calling stored procedure from Reports Data wizard

    What is the exact syntax for entering a stored proc name in the Data wizard, I have created a TEST stored proc which all it does is a simple select statment but the Data wizard complaints that WRONG # of parameter when in fact TEST does NOT take any params. Any ideas?

    I am using Reports 9i & use JDBS query. When it gets to the section that says enter SQL or Stored proc, I enter a simple TEST proc which takes no params & get error msg as explained before ... I don't see any info in the Reports manual as to how to call a proc ... where would I find that info?
    Thx.

  • How to call a PL/SQL procedure from a xml Data Template

    We have a requirement in which we need to call a pl/sql package.(dot)procedure from a Data Template of XML Publisher.
    we have registered a Data Template & a RTF Template in the XML Publisher Responsibility in the Oracle 11.5.10 instance(Front End).
    In the Data Query part of the Data Template , we have to get the data from a Custom View.
    This view needs to be populated by a PL/SQL procedure.And this procedure needs to be called from this Data Template only.
    Can anybody suggest the solution.
    Thanks,
    Sachin

    Call the procecure in the After Parameter Form trigger, which can be scripted in the Data Template.
    BTW, there is a specialized XML Publisher forum:
    BI Publisher

  • How to call a procedure in place of a SQL

    Hi
    Can any one tell me how to call a procedure in place of a SQL from Bi publisher
    Thanks
    Ranga
    Edited by: user13274784 on Jul 22, 2010 9:47 AM

    One way would be to use pipelined table functions. Call the procedure within a function and return data in the form of a table.
    Search the forum.
    Check this out: http://winrichman.blogspot.com/search/label/pipelined
    http://bipublisher.blogspot.com/2007/09/plsql-taking-it-to-next-level.html
    BI publisher to use Stored Procedure
    Edited by: BIPuser on Jul 22, 2010 10:22 AM

  • Calling a procedure from another

    i have tried to call a procedure within another and it gives me this error
    --PLS-00201: identifier 'P_USER_OBJID' must be declared.
    inside the code i put in
    BEGIN proc_to_be_called (input_parameter_only); end;
    help!!!!!

    Ok, example using procedures, functions, IN and OUT parameters and variables.
    Surely this should give you the answer.
    SQL> create procedure B (v_val IN OUT NUMBER) is
      2  begin
      3    v_val := v_val * 10;
      4  end;
      5  /
    Procedure created.
    SQL> create function C (v_val IN NUMBER) RETURN NUMBER is
      2  begin
      3    RETURN v_val * 10;
      4  end;
      5  /
    Function created.
    SQL> ed
    Wrote file afiedt.buf
      1  create procedure A is
      2    v_test1 NUMBER := 5;
      3    v_test2 NUMBER := 10;
      4  begin
      5    B(v_test1);
      6    dbms_output.put_line(v_test1);
      7    dbms_output.put_line(C(v_test2));
      8* end;
    SQL> /
    Procedure created.
    SQL> exec A;
    50
    100
    PL/SQL procedure successfully completed.
    SQL>

  • Need Help: Using Ref Cursor in ProC to call a function within a Package

    I'm calling a function within a package that is returning a REF CURSOR.
    As per the Oracle Pro*C Programmer's Guide, I did the following:
    1) declared my cursor with a: EXEC SQL BEGIN DECLARE SECTION and declared the cursor as: SQL_CURSOR my_cursor;
    2) I allocated the cursor as: EXEC SQL ALLOCATE :my_cursor;
    3) Via a EXEC SQL.....END-EXEC begin block
    I called the package function and assign the return value to my cursor
    e.g. my_cursor := package.function(:host1, :host2);
    Now, the only difference between my code and the example given in the Pro*C Programmer's Guide is that the example calls a PROCEDURE within a package that passes back the REF CURSOR as an OUT host variable.
    Whereas, since I am calling a function, the function ASSIGNS the return REF CURSOR in the return value.
    If I say my_cursor := package.function(:host1, :host2); I get a message stating, "PLS-00201: identifier MY_CURSOR" must be declared"
    If I say :my_cursor := package.function(:host1, :host2); I get a message stating, "ORA-01480: trailing null missing from STR bind value"
    I just want to call a package function and assign the return value to a REF CURSOR variable. There must be a way of doing this. I can do this easily in standard PL/SQL. How can this be done in Pro*C ???
    Thanks for any help.

    Folks, I figured it out. For those who may face this problem in the future you may want to take note for future reference.
    Oracle does not allow you to assign the return value of a REF CURSOR from a FUNCTION ( not Procedure - - there is a difference) directly to a host variable. This is the case even if that host variable is declared a CURSOR variable.
    The trick is as follows: Declare the REF CURSOR within the PL/SQL BEGIN Block, using the TYPE statement, that will contain the call to the package function. On the call, you then assign the return REF CURSOR value that the function is returning to your REF CURSOR variable declared in the DECLARE section of the EXEC SQL .... END-EXEC PL/SQL Block.
    THEN, assign the REF CURSOR variable that was populated from the function call to your HOST cursor varaible. Then fetch this HOST Cursor variable into your Host record structure variable. Then you can deference individual fields as need be within your C or C++ code.
    I hope this will help someone facing a deadline crunch. Happy computing !

  • Calling a package function in the data template

    Hello All,
    I am not able to understand the concept of calling a function from the data template.
    In my data template, I put the sql statement as
    <sqlStatement name="Q_SEL">
    <![CDATA[  Select l_period_name PERIOD_NAME
                             from xla_tb_ap_report_pvt.get_period_name(1) ]]>
    </sqlStatement>
    Is it possible to call a specific package function as shown above in a select statement?
    I am getting the message "ORA-00933: SQL command not properly ended" when I tried with the above. Could you pls. point out what the error is in the above sqlStatement?
    1) My instance is R12.1.3
    2) The base pkg function 'xla_tb_ap_report_pvt.get_period_name' expects a number to be passed in as 'IN' parameter.
    Thanks,
    Monkey

    I tried another version of the sql statement (after going through some older posts) like:
    <sqlStatement name="Q_SEL">
    <![CDATA[  Select xla_tb_ap_report_pvt.get_period_name(1) PERIOD_NAME
                            from  dual]]>
    </sqlStatement>
    My group is :
    <group name="G_PERIOD_NAME" source="Q_SEL">
    <element name="PERIOD_NAME" value="PERIOD_NAME"/>
    </group>
    Now getting the error message:
    ORA-00904: xla_tb_ap_report_pvt.get_period_name : invaild identifier
    What is it that i am doing wrong?
    Thanks,
    Monkey
    Edited by: OAF_Monkey on Mar 26, 2012 11:52 AM

Maybe you are looking for

  • SQL Server 2012 not auto-shrinking logfile

    We recently deployed SQL Server 2012 Standard on a Server 2008 R2 SP1 machine and, for the most part, everything behaves the same as SQL 2008 R2 (no surprise there). However, one issue I've been experiencing is that the transaction logs will not auto

  • Osx 10.5.8 crashes windows 7

    When my dual g5 power mac running 10.5.8 and my wife's acer laptop running window 7 are both connected to my wireless network, windows crashes hard.  Static screen, and loud buzzing from speakers.  Unresponsive, requiring power button restart, or it

  • XML file creation

    I am trying to write XML file from xPath with corresponding values from database. Below are the part of xpath's and values in 1. I am trying to write as XML file with this format in 2(this is part of file). Could any please tell me how to write this

  • OID Working Normally But I Want to Understand "oracle SID " Processes

    I'm runninng OID as part of an Identity Mangagement 10.1.4.0.1 installation on Linux. When I look at the processes that oracle is running I see many "oracle<SID>" processes. I'm looking for where I can read about the different types of processes that

  • Minor flaw in brand new MacBook keyboard area

    The surface material surrounding the keyboard (the area on which you place your hands) has a minor flaw on the left side near the bottom of the screen. It is slightly separated from the body. Can this be repaired/glued at an Apple store? I'd hate to