call the XMLQuery pl sql function

Hi all.
Is anyone know how to call the function sql pl by XMLQuery query?

For example:

I pl sql function "test()".

And the desire to write this way:

Select XMLQuery (' let $t = test()' returning content);

How to change to work?

Thanks for all the answers.
Kind regards
Anton.

following should give you an idea:

SQL> select xmlquery(('if (2*2 = ' || power(2,2) || ') then 1 else ()') returning content) x from dual

X
-----
1
1 row selected.

Tags: Oracle Development

Similar Questions

  • call the collection of sql

    Hello guys,.

    I just wonder can I get the SQL collection via PL/SQL. However, I can't call from pure SQL. In other words,.
    create or replace type plch_number is table of number;
    
    create or replace package den 
    is
    
      my_arr plch_number := plch_number();
      procedure doldur(a pls_integer);
      function func2 return plch_number;
    
    end;
    
    create or replace
    package body den 
    is
    
    procedure doldur(a pls_integer)
    is
    begin
      my_arr.extend(a);
      for i in 1..a
      loop
        my_arr(i) := i;
      end loop;
    end;
    
    
    function func2 return plch_number 
    is
    begin
      return my_arr;
    end;
    
    end;
    I can run the following code without any errors.
    set serveroutput on;
    declare
      a integer;
    begin
      den.doldur(10);
      select count(*) into a from table(den.my_arr);
      dbms_output.put_line(a);
    end;
    
    
    ------------------------------------------
    anonymous block completed
    10
    However, when run the code sql. Although it is almost the same code that I have run PL/SQL block, it gives an error, ORA-06553: PLS-221.
    select * from table(den.my_arr);
    ORA-06553: PLS-221
    In addition, I can call the function from the package through SQL without any error. But why I can't invoke collections directly from SQL, why?
    select * from table(den.func2);
    Thank you.

    970992 wrote:
    OK, but I just want to know, why? I mean, is there a technical explanation?

    Unfortunately, in ORACLE SQL & PL/SQL keep two separate motors. All SQL allows you to call is UDF (user-defined functions). You can't call procedures in SQL and you cannot reference package variables. Everything works and even this is not always possible - for example, you cannot call a UDF with OUT or IN OUT. You cannot call function PL/SQL defined parameter and return value types.

    SY.

  • How to call the OFA PL/SQL procedure.

    Hello

    I'll call the pl/sql stored procedure of the OAF page (AM). the procedure is content parameter 3 IN 1 OUT parameter. all the parameters of character type is integer.


    I put the output parameter and it's returning the value, but I don't have how to configure the setting IN because the settings IN, I need to convert the INT data type number in java.

    Please help me.


    int in_parm1 = 0;
    Number in_param;
    Request_id number;
    request_id = new Number (0);
    getDBTransaction () .commit ();
    TXN OADBTransaction = getOADBTransaction();
    int l_user_id = txn.getUserId ();
    int l_resp_id = txn.getResponsibilityId ();
    int l_resp_appl_id = txn.getResponsibilityApplicationId ();
    Number of ln_user_id = new Number (l_user_id);
    Number of ln_resp_id = new Number (l_resp_id);
    Number of ln_resp_appl_id = new Number (l_resp_appl_id);
    CallableStatement cs = txn.createCallableStatement ("start oaf_request(:1,:2,:3,:4); end; ", 1) ;
    Try
    {
    System.out.println ("run ahead");
    cs.registerOutParameter (3, Types.VARCHAR, 0, 100);
    cs.registerOutParameter(1,in_param);
    cs.registerOutParameter(4,Types.NUMERIC);
    DSI Execute();
    in_parm1 = cs.getInt (4);
    request_id = new Number (in_parm1);
    System.out.println ("Request ID" + in_parm1);
    System.out.println ("run after");
    DSI Close();
    System.out.println ("result");
    }
    catch (System.Exception e)
    {

    throw OAException.wrapperException (e);

    }

    I would tell you to go through the "appeal of PL/SQL procedures and functions" Section in the User Guide.
    Example and the details are there reference.

    Thank you

  • How to get the query of the region "PL/SQL function body returns the query string"?

    Hello

    is it possible to get the query string from the region of type "PL/SQL function body returns the query string"?

    I can get the definition of the region as a PL/SQL procedure, but I am interested in the returned query. I tried to write something like

    < pre > v_return_query: = «...» » ;
    : P49_QUERY: = v_return_query;
    Return v_return_query; < / pre >

    to save the return on hidden item P49_QUERY string, but it does not work. I get the error message: ERR-1002 cannot find the item for the "P49_QUERY" element ID in the application '4000 '.

    Kind regards
    Przemek

    If you need to make reference to a page element in the block then you can use this type of control to avoid having to use generic column names:

    if apex_application.get_current_flow_sgid(:APP_ID) = apex_application.get_sgid then-- runtime  :P9_SQL := vSQL;else-- design time  null;end if;
    

    But if all you want to do is capture the SQL debugging you can take all the references element in the block and use the insert statement (in a debug table) as I showed earlier.

    Scott

  • ORA-900 sql not valid reporting error while calling the optimize_index pl/sql procedure


    Hi Experts,

    I'm on Oracle 11.2.0.3 on Linux and I have installed in my database Oracle text. I want to configure annex dbms_job to optimize my oracle text index. So first, I created a pl/sql procedure to optimize indexes. It gives me error ORA-900, but the sql even if I run in sqlplus works very well! Can you please help me the question is to find:

    Here is the procedure:

    (Either incidentally CTXAPP role has been granted in the schema where these Oracle text indexes are created and where the below procedure to optimize the index is running.)

    CREATE OR REPLACE PROCEDURE optimize_ora_txt_indexes_debug
    IS
       CURSOR cur_context_indexes
       IS
            SELECT index_name
              FROM user_indexes
             WHERE index_type = 'DOMAIN'
        AND ROWNUM<2  
        ORDER BY INDEX_NAME;
       v_user         VARCHAR2 (30);
       v_pod          VARCHAR2 (30);
       v_start_time   TIMESTAMP;
       v_end_time     TIMESTAMP;
       v_elapsed      VARCHAR2 (40);
       v_msg   VARCHAR2 (1000);
       v_error_code      NUMBER;
       v_error_msg   VARCHAR2 (1000);
       v_sql VARCHAR2 (1000);
    BEGIN
    
       FOR c IN cur_context_indexes
       LOOP
          BEGIN
            v_sql:= 'ctx_ddl.optimize_index (idx_name =>'||chr(39)|| c.index_name||chr(39)||', optlevel => '||chr(39)||'FULL'||chr(39)||')';
            dbms_output.put_line(v_sql);
            execute immediate v_sql;
          EXCEPTION
             WHEN OTHERS
             THEN
                v_error_code := SQLCODE;
                v_error_msg := SQLERRM;
                v_msg :=
                      'Error while optimizing the index '
                   || c.index_name
                   || ' '
                   || TO_CHAR (v_error_code)
                   || ' '
                   || v_error_msg;
                DBMS_OUTPUT.put_line (v_msg);
    
          END;
       END LOOP;
    
    EXCEPTION
       WHEN OTHERS
       THEN
          v_error_code := SQLCODE;
          v_error_msg := SQLERRM;
          v_msg :=
                'Error while in the optimize index procedure'
             || ' '
             || TO_CHAR (v_error_code)
             || ' '
             || v_error_msg;
          DBMS_OUTPUT.put_line (v_msg);
    
    END optimize_ora_txt_indexes_debug;
    /
    
     --the procedure compiles successfully. 
     Now when I run it , I get the error:
    SQL>exec optimize_ora_txt_indexes_debug;
    ctx_ddl.optimize_index (idx_name =>'ACCESS_CLNT_IDX04', optlevel => 'FULL')
    Error while optimizing the index ACCESS_CLNT_IDX04 -900 ORA-00900: invalid SQL
    statement
    
    
     --When I run the same command from sqlplus as execute statement , it works fine:
    SQL>exec ctx_ddl.optimize_index (idx_name =>'ACCESS_CLNT_IDX04', optlevel => 'FULL');
    PL/SQL procedure successfully completed.
     
     
    
    
    

    If everything runs from sqlplus, but fails in plsql... I'll be very grateful for pointers solve the problem.

    Thanks,

    OrauserN

    Hello

    It is a problem of pl/sql syntax. A call with EXEC is the same using BEGIN... Code of... END of block;

    SO, you need to include a beginning and an end to your call:

     v_sql:= 'BEGIN ctx_ddl.optimize_index (idx_name =>'||chr(39)|| c.index_name||chr(39)||', optlevel => '||chr(39)||'FULL'||chr(39)||'); END;';
    

    That's all.

    Herald tiomela

    http://htendam.WordPress.com

  • Call the Flash of IE10 function

    Hey guys,.

    So, I'm looking to have some javascript call a flash function.  I have it fully functional with older versions of IE, as IE9. However IE10 won't.

    I followed the example provided by Adobe here: http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/Flash/external/external Interface.html #addCallback ()

    Using this code example, (in IE10) I'm successfully able to send data to flash on my Javascript, but coming from the other direction, it does not work.

    The error I get is (' object does not support property or method 'methodNameHere' ")

    Does anyone have ideas of what I could use to do?  Or IE10 does not support this communication longer?  Any thoughts are appreciated, thank you!

    ExternalInterface.call("saveglobalscore",score), as you know, is easy to implement.

    ExternalInterface.addCallback("IsStatic",IsStatic) is must more difficult because he has not a lot of flexibility in the HTML, code integration.

    in your embed code, you (try to) embed a swf file that is named ExternalInterfaceExample.swf.  If the SWF with your method addCallback test.swf, it's a problem.

    you need to change one or the other.

  • Call the allocation of memory function of library

    Hello

    I want to call a dll of LabVIEW and one of the entries expects a pointer to double (double *). I did things like that before and use create table to allocate memory in LabVIEW to pass to the dll. This time what is expected is a pointer to a unique double. Can I just wire a double digital scheme at the entrance or it will not really affect memory?

    ToeCutter wrote:

    I want to call a dll of LabVIEW and one of the entries expects a pointer to double (double *). I did things like that before and use create table to allocate memory in LabVIEW to pass to the dll. This time what is expected is a pointer to a unique double. Can I just wire a double digital scheme at the entrance or it will not really affect memory?

    It would be preferable to wire a single instead of a double, but other than that (Oops, misread "double single" as "single"), Yes, it will correctly allocate memory. You just configure the parameter as a double single from pointer.

  • PL/SQL function to calculate the non-working days

    Hello

    I have the following pl/sql function which generates a number of days between two selected dates (i.e. excluding weekends). However, I also need to exclude specific holidays - day of Christmas etc. These holiday dates are stored in a table in our database (11 GR 2) called "HOLIDAY".

    How can I integrate the holidays which is held in the table of holidays in the following query to exclude these dates as well? I know how to write a separate funtion pl/sql for a number of days between two dates using SELECT... BUT I can't work out how to bring together them in a single query.

    Could someone show me how with the pl/sql / dates below please?

    Example of HOLIDAY table below.

    Thank you!

    TP

    create or replace
    function WORKING_DAYS (pi_start_date in date, pi_end_date in date) return integer
    
    is
    
    v_start_date date :=pi_start_date;
    v_end_date date:=pi_end_date;
    v_count integer:=0;
    
    begin
    
    while v_start_date <= v_end_date
          loop
                            if to_char(v_start_date,'D') not in ('6','7')                    
                            then
                            v_count := v_count+1;                       
                            end if;
                           
                    v_start_date:=v_start_date+1;
                   
          end loop;
         
    return v_count;
    
    end;
    
    

    (select '10-Apr-2013' as NWD from dual union all
    select '06-May-2013' from dual union all
    select '27-May-2013' from dual union all
    select '26-Aug-2013' from dual union all
    select '26-Dec-2013' from dual union all
    select '25-Dec-2013' from dual union all
    select '01-Jan-2014' from dual union all
    select '18-Apr-2014' from dual union all
    select '21-Apr-2014' from dual union all
    select '05-May-2014' from dual union all
    select '26-May-2014' from dual union all
    select '25-Aug-2014' from dual union all
    select '25-Dec-2014' from dual union all
    select '26-Dec-2014' from dual) HOLIDAYS
    

    Hello

    the link is on MOSC, not OTN... Here's a copy:

    This function calculates the number of days between two dates, ignoring weekends and holidays (if requested and if the holidays are stored in a table)

    I give an example of table 'public_holiday' with sample data, but users must ensure that their table contains the relevant data (all holidays within the maximum range of use of the service)

    CREATE TABLE public_holiday (calendar_day, DATE, text VARCHAR2 (30));

    FUNCTION to CREATE or REPLACE nb_days (p_date_from IN DATE

    p_date_to DATE by DEFAULT TRUNC (sysdate)

    , p_public_holidays in CHAR DEFAULT 'Y '.

    ) RETURN NUMBER

    DEFINE AUTHID

    AS

    /*********************************************************************/

    / * Author: Bruno Vroman * /.

    / * Created: 23-AUG-2012 * /.

    / * Last updated: 23-AUG-2012 * /.

    / * Object: to calculate the number of days between 2 dates, to the exclusion of * /.

    / * Saturday and Sunday, but also "holidays" If the * /.

    / * argument 'p_public_holidays' = 'Y ' * /.

    / * Support: p_date_from<= p_date_to                             ="">

    / * component ' hour min dry "ignored (just counting days) * /.

    /* First step:                                                       */

    / * the calendar days between 2 days * /.

    / Remove 2 days for each "week" and 0 or 1 extra day * /.

    / * function to a condition "complex" mix day of first week * /.

    / * and the number of days when full remaining weeks are removed * /.

    / * (set up once for all, for example if there is 3 days and the * /)

    (/ * first day is a Thursday, there is 1 "Sat/Sun" to subtract) * /.

    / * Second step: If 'p_public_holidays' = 'Y': other * /.

    / * days, do not count holidays.                         */

    / Holiday everyday are defined in a table "public_holiday" * /.

    / * Note: there may be holidays defined on Saturday/Sunday.       */

    /*********************************************************************/

    l_result NUMBER;

    l_from DATE;

    l_to DATE;

    l_case tank (4);

    BEGIN

    l_from: = TRUNC (p_date_from);

    l_to: = TRUNC (p_date_to);

    l_case: = TO_CHAR (l_from, 'Dy', 'NLS_DATE_LANGUAGE = English').

    To_char (MOD (l_to - l_from + 1, 7));

    l_result: = l_to - l_from + 1

    -TRUNC ((l_to-l_from + 1) / 7) * 2

    -CASE

    WHEN l_case IN ('Mon6', 'Tue5', 'Wed4', 'Thu3', 'Fri2'

    , "Sat1", "Sun1", "Sun2', 'Sun3", "Sun4".

    , "Sun5', 'Sun6.

    )

    THEN 1

    WHEN l_case IN ('Tue6', 'Wed5', 'Wed6', 'Thu4', "Thu5"

    , 'Thu6', 'Fri3', 'Fri4', 'Fri5', 'Fri6 '.

    , "Sat2", "Sat3', 'Sat4', 'Sat5", "Sat6.

    )

    THEN 2

    0 OTHERWISE

    END

    ;

    IF SUPERIOR (p_public_holidays) = "Y".

    THEN

    SELECT l_result - COUNT (*)

    IN l_result

    OF public_holiday p

    WHERE p.calendar_day > = l_from

    AND p.calendar_day<=>

    AND SUBSTR (TO_CHAR (p.calendar_day

    , "Dy".

    'NLS_DATE_LANGUAGE = English'

    )

    , 1, 1 ) != 'S'

    ;

    END IF;

    RETURN l_result;

    EXCEPTION

    WHILE OTHERS

    THEN

    DBMS_OUTPUT. Put_line (' CTF nb_days (' |))

    To_char (p_date_from, "MON-DD-YYYY"). ', ' ||

    To_char (p_date_to, "MON-DD-YYYY"). ', ' ||

    p_public_holidays | ' ) : ' || SQLERRM

    );

    LIFT;

    END nb_days;

    /

    REM

    REM example:

    REM A) fill out the 'public_holidays '.

    REM

    TRUNCATE TABLE public_holiday;

    INSERT INTO public_holiday VALUES (DATE ' 2012-01-01', ' new year (a Sunday)');

    INSERT INTO public_holiday VALUES (DATE '' 2012-01-03, "for example");

    REM (insert other days...)

    COMMIT;

    Call the function for some pairs of dates of REM B)

    REM nb1: remove only Sat/Sun

    REM nb2: also remove holidays

    REM

    ALTER SESSION SET nls_date_format ='Dy DD-MON-YY';

    WITH some_dates AS

    (SELECT DATE ' 2011-12-29'd dual FROM

    UNION ALL SELECT DATE ' 2012-01-08' FROM dual

    UNION ALL SELECT DATE ' 2012-01-10' FROM dual

    )

    SELECT d1.d 'FROM '.

    , d2.d ' to THE '.

    , nb_days (d1.d, d2.d, ' don't) nb1

    , nb_days (d1.d, d2.d, 'Y') nb2

    OF some_dates d1

    some_dates d2

    WHERE d1.d<=>

    ORDER BY nb1, nb2, d1.d

    ;

    GO TO NB1 NB2

    ------------- ------------- ---- ----

    Monday, January 8, 12 Monday, January 8, 12 0 0

    Friday, December 29, 11 Friday, December 29, 11 1 1

    Wednesday, January 10, 12 Wednesday, January 10, 12 1 1

    Monday, January 8, 12 Wednesday, January 10, 12 2 2

    Friday, December 29, 11 Monday, January 8, 12 7 6

    Friday, December 29, 11 Wednesday, January 10, 12 9 8

    Hope that this could be useful, but note that this code has not been completely tested, so check and test before you trust it (in the case of any questions, please post a comment)

    Bruno Vroman.

    Best regards

    Bruno

  • Call the function of database from a process of OnDemand

    Hi all

    I'm stuck in a mud.

    I created a PL/SQL function to call a function of database and return with the days between two fields. It works fine and I get the results.

    But now I want to do the same thing in a process of anonymous request asked PL/SQL

    Don't know why its not working, I should change the script below I use the anonymous PL/SQL function instaed?
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    DECLARE
    ANSWER1 VARCHAR2 (200);
    ANSWER2 VARCHAR2 (200);
    BEGIN

    ANSWER1: = tw_operations_vic.NETWORKDAYS(:P10_AGREED_COMPLETION_DATE,SYSDATE);


    Return ANSWER1;
    END;
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Frank

    Hi Frank,.

    In a procedure, you can use BACK (it's only for functions). For an application process, use htp.p (answer1) and get this response in the Javascript code that you use to call this process.

    Greetings,
    Roel

    http://roelhartman.blogspot.com/

  • How to call the pl/sql function in application of the ADF

    Hi Experts,

    I need to call the pl/sql function in application of ADF, I have logic written in my AM

    Method:

    public String reportStoredProcedure (locationID customerID, number,
    String tailNum) {}

    CallableStatement st = null;
    String v_sanctioned = null;
    If (locationID! = null & & customerID! = null & & tailNum! = null) {}
    System.out.println (locationID + "" + customerID + "" + tailNum);
    Tail string = "TAIL";
    String result = "N";

    try {}
    String stmt =
    "start XXWFS_SANCTIONS_PKG. CHECK_SANCTION(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11); end; « ;
    St = getDBTransaction () .createCallableStatement (stmt, 0);
    st.setNull (1, Types.VARCHAR);
    st.setNull (2, Types.NUMERIC);
    st.setObject (3, customerID);
    st.setNull (4, Types.NUMERIC);
    st.setNull (5, Types.NUMERIC);
    st.setObject (6, locationID);
    st.setNull (7, Types.NUMERIC);
    st.setNull (8, Types.NUMERIC);
    st.setObject (9, tail);
    st.setObject (10, tailNum);
    st.setObject (11, result);
    St.Execute ();
    System.out.println ("v_sanctioned in AM:" + v_sanctioned);
    } catch (Exception e) {}
    e.printStackTrace ();
    return "N";
    } {Finally
    If (st! = null)
    try {}
    St.Close ();
    } catch (Exception e1) {}
    E1. PrintStackTrace();
    return "N";
    }
    }
    } else {}
    System.out.println ("v_sanctioned is null");
    v_sanctioned = "N";
    }
    Return v_sanctioned;
    }


    Error:

    java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in the call to 'CHECK_SANCTION '.
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)
    at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:191)
    at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:950)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1224)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3386)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3487)
    at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:3858)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
    at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:99)
    at model.view.CardAMImpl.reportStoredProcedure(CardAMImpl.java:182)
    at com.emboss.bean.ReadyToPrint.invokeVSanctioned(ReadyToPrint.java:485)
    at com.emboss.bean.ReadyToPrint.PrintingCards(ReadyToPrint.java:434)
    at com.emboss.bean.ReadyToPrint.printCards(ReadyToPrint.java:204)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
    at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1259)
    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
    at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:97)
    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:90)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:309)
    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:94)
    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:91)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:812)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:292)
    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:420)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:94)
    at java.security.AccessController.doPrivileged (Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.doIt (WebAppServletContext.java:3684)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3650)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Can someone help me how to call...

    Call it in function, not as a procedure you do

    try {
    String stmt =
    "begin :1 := XXWFS_SANCTIONS_PKG.CHECK_SANCTION(:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12); end;";
    st = getDBTransaction().createCallableStatement(stmt, 0);
    st.registerOutParameter(1, Types.VARCHAR);
    st.setNull(2, Types.VARCHAR);
    st.setNull(3, Types.NUMERIC);
    st.setObject(4, customerID);
    st.setNull(5, Types.NUMERIC);
    st.setNull(6, Types.NUMERIC);
    st.setObject(7, locationID);
    st.setNull(8, Types.NUMERIC);
    st.setNull(9, Types.NUMERIC);
    st.setObject(10, tail);
    st.setObject(11, tailNum);
    st.setObject(12, result);
    st.execute();
     = st.getString(1);
    
  • PL/SQL anonymous block - try to call the function within cursor

    Hello-

    I need to create an anonymous block that contains a cursor and function. I want to call the function from the cursor and function will essentially have an ID as parameter and will return a list of values comma separated.

    However, when I try to do it I get the error 'function 'GET_PAYMENT_DATES' is not usable in SQL.

    Does anyone know of a workaround? I'm trying to avoid having to store this function.

    Thank you
    Christine

    Well you can't do this using an sql not stored function.
    What you could do is to increase your sort_area_size which can help you to overcome the performance Bug.

    for example: alter session set sort_area_size = 64000;

    other than that, it seems that you need a stored function

  • Call the function browser plsql (403 error)

    Hello

    I m pl/sql developer and I m new in APEX. In fact, I have little trouble with Express application, authorization and call browser plsql. I found the pl/sql procedure to see the image (actually I don't like in pl/sql, I'll be happy if I calll Hello World of browser).

    My Info: Oracle 12.1 c, Windows 7, default APEX 4.2

    I found it is appeal possible function of the url in this way: http://localhost:8080/apex/APEX_040200.just_print and he return 403 for me, where:

    Just_print is defined as

    create or replace
    PROCEDURE JUST_PRINT AS
    BEGIN
    htp.p('HAF');
    END;
    

    Just_print, it's in the APEX_040200 scheme

    According to web articles that I give perform this function ANONYMOUS or APEX_PUBLIC_USER or PUBLIC. I don't like the safety (my local host, learning...) so I have him granted for all:

    grant execute on just_print to anonymous,apex_public_user,public;
    

    It must stop return 404 (not found) and start to return a 403 (forbidden) - it works (for anonymous scholarship, but I hold decided run grant for all accounts - just for sure)

    Now, according to web I must change the function wwv_flow_epg_include_mod_local (in the APEX_040200 schema) and add the name of function. I tried but doesn't work. Yes, there is first line of the procedure returns alwas FAKE and I remove it, I also added the procedure IN the list. And also modified function that simply returns TRUE. Nothing works, real version is:

    create or replace 
    function                                     wwv_flow_epg_include_mod_local(
        procedure_name in varchar2)
    return boolean
    is
    begin
        if upper(procedure_name) like '%PRINT%' or upper(procedure_name) like '%IMAGE%' then
            return TRUE;
        else
            return FALSE;
        end if;
    end wwv_flow_epg_include_mod_local;
    

    (u just removed comments to be the shortest).  Here it's like printing (the function) and image (feature first tried) and superior, also when I try this:

    begin
    if apex_040200.wwv_flow_epg_include_mod_local('just_print') then 
     dbms_output.put_line('OK'); 
     else dbms_output.put_line('FAIL');
     end if;
    end;
    

    It will print OK (and also for ctrl + c/ctrl + v in web broswer) and also for any changes - APEX_040200.JUST_PRINT etc so it should not be a typo error.

    When I call just_print or PL/SQL region show_image (create page - add plsql - region and add the code begin just_print; end ;) it works.)

    Also, I've run the instalation guide ACL policy (all).

    I not found any other step to must be done - so I don't have anything else.

    --

    Any suggestion what I am doing wrong? (except the whole life, but this is another story...) )

    THANK YOU VERY MUCH

    Hello

    I don't think it's your problem, but it's bad idea create procedures to the diagrams of the system as APEX_040200.

    Create procedure to the own schema and then create public synonym for it.

    Grant execute privilege to public for the procedure, just to test.

    And change 040200.wwv_flow_epg_include_mod_local function always returns true, just to test

    create or replace
    function wwv_flow_epg_include_mod_local(
        procedure_name in varchar2
    ) return boolean
    is
    begin
      return FALSE;
    end wwv_flow_epg_include_mod_local;
    

    Then try the URL http://localhost: 8080/apex/just_print

    Kind regards

    Jari

  • A c from pl/sql function call

    Hello

    I'm testing a simple case to call a C function from a pl/sql block.

    Here's my test case (came to :)

    TST.c:

    #include < ctype.h >

    #include < stdio.h >

    int upcase (char * istr, char * ostr)

    {

    int i = 0;

    While (ISTR)

    {

    OSTR [i] = toupper (istr [i]);

    i ++ ;

    }

    return 0;

    }

    // compile
    gcc -fPIC -c tst.c

    // create shared object

    ld -shared -o libtest.so tst.o

    file libtest.so

    libtest.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

    // wrapper library and function

    SQL> create or replace library libtest as '/home/oracle/libtest.so';
    /
    Library created.


    create or replace function upcase (instr in varchar2, outstr out varchar2) return directory is

    external

    libtest library

    name 'upcase '.

    C language

    call the standard C

    settings)

    string InStr,

    outStr string

    );

    /

    Listener.ora:

    LISTENER =

    (ADDRESS_LIST =

    (ADDRESS = (PROTOCOL = TCP)(Host = server1) (Port = 1521))

    (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC))

    )

    SID_LIST_LISTENER =

    (SID_LIST =

    (SID_DESC =

    (GLOBAL_DBNAME = PRD_DGMGRL)

    (ORACLE_HOME = home/app/product/11.2.0/jko)

    (SID_NAME = PRD)

    )

    (SID_DESC =

    (ORACLE_HOME = home/app/product/11.2.0/jko)

    (SID_NAME = PLSExtProc)

    (= Extproc PROGRAM)

    (ENVS = "EXTPROC_DLLS = ANY")

    )

    )

    LOG_DIRECTORY_LISTENER = / home/app/network/log

    CONNECT_TIMEOUT_LISTENER = 10

    TRACE_DIRECTORY_LISTENER = / home/app/network/trc

    STARTUP_WAIT_TIME_LISTENER = 0

    USE_PLUG_AND_PLAY_LISTENER = OFF

    ADMIN_RESTRICTIONS_LISTENER = WE

    LOG_FILE_LISTENER = listener.log

    TRACE_LEVEL_LISTENER = OFF

    tnsnames.ora:

    EXTPROC_CONNECTION_DATA =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC))

    (CONNECT_DATA = (SID = plsextproc))

    )

    declare

    str1 varchar2 (20);

    VARCHAR2 (20) str2;

    Directory of RC;

    Start

    str1: = "Hello World";

    RC: = upcase (str1, str2);

    dbms_output.put_line (' rc ='|) RC: ' instr =' | str1 |' outstr =' | str2);

    end;

    /

    declare

    str1 varchar2 (20);

    VARCHAR2 (20) str2;

    Directory of RC;

    Start

    str1: = "Hello World";

    RC: = upcase (str1, str2);

    dbms_output.put_line (' rc ='|) RC: ' instr =' | str1 |' outstr =' | str2);

    end;

    /

    ERROR on line 1:

    ORA-28576: interruption of the RPC connection to the external procedure agent

    ORA-06512: at "SYS." UPCASE', line 1

    ORA-06512: at line 7

    How I did wrong?

    Thanks a lot for your help

    jko

    The error means generally that your external procedure (process c in this case), failed or crashed.

    The details of the Oracle error:

    28576, 00000, "loss of the RPC connection to the external procedure agent."
    * Cause: A fatal error occurred either a RPC network connection.
    agent extproc or the invoked 3GL after disclosure
    was created successfully.
    * Action: First check the 3GL code you are calling; the most likely
    This error is an abnormal termination of the
    called 'C' routine. If this is not the case, look for
    network problems. Correct the problem if you find. If all the
    components appear normal, but the problem persists, the
    problem could be an internal logic error in the transfer of the CPP
    code.  Contact your customer support representative.

    Probably the dynamic loader used by the kernel to resolve external dependencies than physical of the executable failed?

    Mike Board solves the problem? IMO, it should...

  • Call to Web Service of Oracle PL/SQL not to call the Web service in SOA Server

    Hello

    Try to call the Web service to oralce pl/sql function

    created a function

    Unable to invoke the web service from the server of the SOA.

    CREATE or REPLACE FUNCTION HelloWorld_WebServices(S_STRING Varchar2) RETURN VARCHAR2 as

    Server sys.utl_dbws. SERVICE;

    APPEL_ sys.utl_dbws. CALL;

    service_qname sys.utl_dbws. QNAME;

    port_qname sys.utl_dbws. QNAME;

    response sys. XMLTYPE;

    application sys. XMLTYPE;

    BEGIN

    sys.utl_dbws.set_http_proxy ("hostname: Port'");

    service_qname: = sys.utl_dbws.to_qname ("ns1", "process");

    Server: = sys.utl_dbws.create_service (service_qname);

    APPEL_: = sys.utl_dbws.create_call (server);

    sys.utl_dbws.set_target_endpoint_address (APPEL_, ' http:/host name: port/soa-infra/services/OFS/HelloWorld/helloworld_client_ep ');

    sys.utl_dbws.set_property (APPEL_, 'OPERATION_STYLE', 'process');

    asks: = sys. XMLTYPE ("< ns1:process xmlns:ns1 ="http://xmlns.oracle.com/OFSOrderServices/HelloWorld/HelloWorld"> < ns1:input > < / ns1:input > < / ns1:process > '"); 

    answer: = sys.utl_dbws.invoke (APPEL_, request);

    return response.extract('//HelloWorld/child::text() ','http://xmlns.oracle.com/OFSOrderServices/HelloWorld/HelloWorld'). getstringval(); 

    DBMS_OUTPUT. Put_line ("values of the OutputsVariables8");

    -Of return ';

    END;

    Run - the code below:

    Select HelloWorld_WebServices ('Hi') to double;

    Error:

    ORA-29532: Java call terminated by eception Java exception: java.lang.NoClassDefFoundError

    ORA-06512: at "SYS." UTL_DBWS', line 403

    ORA-06512: at "SYS." UTL_DBWS', line 400

    ORA-06512: at the 'APPS '. HELLOWORLD_WEBSERVICES', line 74

    29532 00000 - "Java call terminated by eception Java exception: %s."

    * Cause: A mistake or a Java exception has been reported and could not be

    solved by Java code.

    * Action: Modify Java code, if this behavior is not expected.

    Hello

    Fixed the error

    After loading once again of DBA and network provided access files JAR/JVM firewall

    and the correction on the threshold

    Return response.extract (' / result/child::text () ','xmlns = "http://xmlns.oracle.com/OFSOrderServices/HelloWorld/HelloWorld" '). getstringval();

  • Call the PLSQL function - ORA-31013: XPATH not valid expressioon

    I tried the following SQL statement. When I called the function, it in error.


    Select *.

    Since the release of v$.

    ----

    1Oracle Database 10 g Enterprise Edition release 10.2.0.3.0 - 64bi
    2PL/SQL version 10.2.0.3.0 - Production
    3CORE 10.2.0.3.0Production
    4AMT for Linux: release 10.2.0.3.0 - Production
    5NLSRTL Version 10.2.0.3.0 - Production



    function READ_SYSTEM_RESPONSE (PARAM IN CLOB)

    RETURN NUMBER

    AS

    " l_namespace varchar2 (1000): =' xsi: schemaLocation =" http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader ' PackageProxy.xsd '

                                    xmlns:sh=" http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader "

                                    xmlns:ef=" http://www.efatura.gov.tr/package-namespace "

                                    xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "';

    XmlType x

    : = XMLTYPE ("<?") XML version = "1.0" encoding ="UTF - 8"? >

    " < sh: StandardBusinessDocument xsi: schemaLocation =" http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader ' PackageProxy.xsd '

                          xmlns:sh=" http://www.UNECE.org/CEFACT/namespaces/StandardBusinessDocumentHeader "

                          xmlns:ef=" http://www.efatura.gov.tr/package-namespace "

                          xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance ">

    < sh: StandardBusinessDocumentHeader >

    < sh: HeaderVersion > 1.0 < / sh: HeaderVersion >

    < / sh: StandardBusinessDocumentHeader >

    (< / sh: StandardBusinessDocument > ');

    Ana CURSOR IS

    SELECT 1 - EXTRACTVALUE (VALUE (p),'/ sh: StandardBusinessDocumentHeader/sh: HeaderVersion', l_namespace) AS IMZA

    TABLE (XMLSEQUENCE (EXCERPT of (x,'/ sh: StandardBusinessDocument', l_namespace))) p;

    BEGIN

    FOR ana IN r

    loop

    dbms_output.put_line ('-');

    end loop;

    RETURN 1;

    EXCEPTION WHEN OTHERS THEN

    dbms_output.put_line (SQLERRM);

    RETURN 0;

    END;

    Delete this l_namespace chain, it has nothing to do there, it is not a namespace declaration:

    "xsi: schemaLocation ="http://www.unece.org/cefact/namespaces/StandardBusinessDocumentHeader PackageProxy.xsd

    As a general rule, simply declare the or - prefixes or by default - you need resolve the XPath expression.

    Once you correct this part, you will discover that your query returns null.

    This is because the XPath expression is not point to any node.

    Try this instead:

    SELECT EXTRACTVALUE)

    VALUE (p)

    , ' / sh: StandardBusinessDocument/sh: StandardBusinessDocumentHeader/sh: HeaderVersion'

    l_namespace

    ) AS IMZA

    TABLE)

    XMLSEQUENCE)

    EXTRACT (x, ' / sh: StandardBusinessDocument', l_namespace)

    )

    ) p

    ;

Maybe you are looking for

  • Problem starting the BIOS NB10t-A-101

    I just bought a NB10t to the United Kingdom and try to boot to a bootable USB key I noticed that the BIOS on this particular model is UEFI mode only, which, in itself, is not a problem because users can sign their own operating systems with a certifi

  • Portege R700-186 - how to install the 3G connection?

    I just bought a R700186 and tried to put the sim card from my Iphone in the laptop to check the GSM connection worked although I will soon he needed to travel abroad, but no internet connection. You have to install windows etc before it works is it p

  • Skype blocks some time after startup

    It began happening out of the blue, has not installed anything it is uninstalled or whatever it is, I don't even have the automatic updates for all programs.Yes, I look for solutions and tried them.No, they did not work.I don't have a webcam.I tried

  • Windows memory diagnostic tool does not work well

    HelloI have memory problem in vista, but I run the application above it works well, but after completion of this test and the PC is automatically restart, 1 - I don't see the icon of results on the taskbar. 2- Also, I don't see any action on event vi

  • Optical drive went lack of Vista SP1 based computer laptop HP

    Hello  I have Pavilion dv6000 laptop. I see that the optical drive lightscribe is missing from 'my computer' as well as Device Manager. I deleted iTunes, upperfilters/down filters, re-allocation of places the disk and no troubleshooting as indicated