Missing PL/SQL function TO_BINARY_INTEGER

In "Oracle 8i: The Complete Reference" it mentions the function TO_BINARY_INTEGER. This is exactly the function I need. However, in trying to use it in stored function, I keep getting the error that it is not defined. Does this function in fact exist? If so, how should I be accessing it.

I have the recently published Oracle 8i DBA Certified Professional DBA Certificantion Exam Guide.
It lists TO_CHAR, TO_DATE, TO_MULTI_BYTE, TO_NUMBER, and TO_SINGLE_BYTE functions but does not list the one you describe.

Similar Messages

  • Application Report Missing PL/SQL Functional Area

    All,
    I just wanted to bring to the ApEx developers something I just noticed... I use the Shared Components > Database Object Dependencies report to make sure all is well before moving applications into production.
    The Parsing Errors feature of that report is WONDERFUL! But it seems to be overlooking buttons that use a conditional display based on PL/SQL Function Body Returning a Boolean.
    Dan

    Hi Dan,
    I think the place is perfect, but I read once somewhere that "Bug" or "Bug Report" should be in the subject so that's easier to find for the Oracle guys.
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Query on Reoprts-pl/sql function body returning sql query

    Hi,
    I am facing a starnge problem.. and would like to know the reason for it.
    The situation is as follows:
    I have a report (pl/sql function body returning sql query based). My query is as follows:
    declare
    l_query1 varchar2(2000);
    begin
    if (:P102_min_value is not null and :P102_max_value is null) then
    l_query1 := 'select decode(:P102_date,'1',date1) Transaction_Date, decode(:P102_first_name,'2',first_name) First_Name from (
    select * from MORTGAGE_LOAN_LEADS where APPRX_LOAN_AMOUNT >=:P102_min_value
    return (l_query1);
    end if;
    end;
    This returns the error as :
    1 error has occurred
    Function returning SQL query: Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the generic columns checkbox below the region source to proceed without parsing.
    (ORA-06550: line 7, column 20: PLS-00103: Encountered the symbol "1" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between || multiset member SUBMULTISET_)
    How do i correct this? am i right in thinking that the single quotes indicating a string within a select query is creating the problem? Beacuse if i use an sql query report and use the following query, it is working fine...
    select
    decode(:P102_date,'1',date1) Transaction_Date,
    decode(:P102_first_name,'2',first_name) First_Name
    from (
    select * from MORTGAGE_LOAN_LEADS where APPRX_LOAN_AMOUNT >=:P102_min_value
    But i need to write pl/sql function, so that multiple report can be returned based on different conditions. Please guide me.
    Thanks,
    Sumana

    Does that mean that both in if and else we need to have same columns selected?
    if thats the case.. any idea how i can implement it in my code. The situation here is that the columns that need to be selected are dynamic and keep on changing...
    if i try to implement like this and run the page, it gives the following error:
    Query is:
    declare
    l_query1 varchar2(4000);
    begin
    if apex_application.get_current_flow_sgid(:APP_ID) = apex_application.get_sgid then
    if (:P102_min_value is not null and :P102_max_value is null) then
    l_query1 := 'select decode(' || :P102_date|| ',''1'',date1) Transaction_Date, decode(' || :P102_first_name || ',''2'',first_name) First_Name from (
    select * from MORTGAGE_LOAN_LEADS where APPRX_LOAN_AMOUNT >=' || :P102_min_value ||'
    elsif (:P102_min_value is null and :P102_max_value is not null) then
    l_query1 := 'select decode(' || :P102_date|| ',''1'',date1) Transaction_Date, decode(' || :P102_first_name || ',''2'',first_name) First_Name from (
    select * from MORTGAGE_LOAN_LEADS where APPRX_LOAN_AMOUNT >=' || :P102_max_value ||'
    else
    l_query1 := 'select date1,first_name from MORTGAGE_LOAN_LEADS where rownum = 1';
    end if;
    else
    l_query1 := 'select date1,first_name from MORTGAGE_LOAN_LEADS where rownum = 1';
    end if;
    return l_query1;
    --dbms_output.put_line( l_query1);
    end;
    The Error is:
    failed to parse SQL query:
    ORA-00936: missing expression
    If i try to run the same in command prompt, it always goes to the else part... (else of outer if)

  • 4.1EA2 Text cursor goes missing in SQL Worksheet

    In EA1 and EA2, my cursor seems to intermittently go missing in SQL Worksheet
    Version info:
    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 14.04.2 LTS
    Release: 14.04
    Codename: trusty
    (Running unity)
    $ java -version
    java version "1.8.0_25"
    Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
    Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
    (edit: Just tested in Windows - cursor does not go missing)
    One such pattern that I noticed it seems to go missing on is when running a script.
    Another pattern, if I hit enter a few times before the cursor has a chance to blink in between (not always), or hit the up or down arrow to go to the top or bottom of the page respectively, it also disappears.
    I'm able to get the mouse back by dragging the window out of maximize position.
    Couldn't reproduce in a procedure editor - assume will be same for package/function editor. So it's most prominent in SQL Worksheet.
    Message was edited by: trent I've had SQL Dev closed half a dozen times since reporting this, and now it seems OK. But it does seem to come and go =/

    I'm having this same issue that started happening with EA1 and persisted into EA2. It was not occurring prior to my upgrade. My input cursor disappears when scrolling up or down in code using the mouse wheel or scroll bar when the code extends beyond the display area. Moving the window does not help, but resizing the window appears to cause it to redraw and the cursor appears again. I can see what line I am on due to current line highlighting, and I can also select text or start typing to get an idea of where I am.
    OS:
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 14.04.2 LTS
    Release: 14.04
    Codename: trusty
    Linux 3.13.0-46-generic x86_64
    Java:
    java version "1.8.0_40"
    Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
    Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
    100% reproducible.
    Note that I was running 4.0.1.14.48 prior on Java 8 so it's likely a recent change and most likely not related to going from Java 7 to 8.
    (Previous version determined by ls -d ~/.sqldeveloper/system* which returned the following:
    Jul  7  2014 system4.0.1.14.48/
    Mar 13 16:00 system4.1.0.17.29/
    Mar 19 13:29 system4.1.0.18.37/

  • XMLType schema detail lost in pl/sql function for a jdeveloper webservice

    If I write a very simple pl/sql procedure to wrap as a web service to return the XML from an XMLtype table column, the jdeveloper (11.1.1.3) web service generation process seems to ignore the detail
    of the registered XMLTypes' schema, and converts the 'output' to an xsd:string in the generated WSDL file, which has knock on effect that generated data controls are 'dumb' in only seeing output as a string, and providing no real data functionality at XML schema level. Since I know web service data controls work fine when provided with the correct level of detail in the WSDL, what am I missing in terms of pursuading jdeveloper to generate wsdl's with full xsd schema info for the return XMLType?
    This is my table:
    ID NOT NULL NUMBER(12)
    SPEC SYS.XMLTYPE(XMLSchema "http:
    //localhost:8080/public/demo
    /xsd/sample2.xsd" Element "b
    ooks") STORAGE BINARY
    PRD_ID NOT NULL NUMBER(10)
    ISSUE NOT NULL NUMBER(6)
    EDIT_NO NOT NULL NUMBER(6)
    PUBLISHED_BY_PEO_ID NUMBER(10)
    PUBLISHED_ON_DT DATE
    EFFECTIVE_FROM_DT NOT NULL DATE
    EFFECTIVE_TO_DT DATE
    =======================================================
    This is the XML Schema:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="urn:books"
    xmlns:bks="urn:books">
    <xsd:element name="books" type="bks:BooksForm"/>
    <xsd:complexType name="BooksForm">
    <xsd:sequence>
    <xsd:element name="book"
    type="bks:BookForm"
    minOccurs="0"
    maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BookForm">
    <xsd:sequence>
    <xsd:element name="author" type="xsd:string"/>
    <xsd:element name="title" type="xsd:string"/>
    <xsd:element name="genre" type="xsd:string"/>
    <xsd:element name="price" type="xsd:float" />
    <xsd:element name="pub_date" type="xsd:date" />
    <xsd:element name="review" type="xsd:string"/>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:string"/>
    </xsd:complexType>
    </xsd:schema>
    =================================================
    This is the pl/sql:
    function GetSpecificationById (p_spec_id in NUMBER) return XMLType
    IS
    l_specification sys.XMLType;
    BEGIN
    select specification
    into l_specification
    from specifications
    where id = p_spec_id;
    return l_specification;
    EXCEPTION
    WHEN OTHERS THEN -- handles all other errors
    ROLLBACK;
    END GetSpecificationById;
    ==============================================
    And this is the generated WSDL:
    <?xml version="1.0" encoding="UTF-8" ?>
    <wsdl:definitions
    name="MyWebService1"
    targetNamespace="http://devsafetrytrailcom/MyWebService1.wsdl"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://devsafetrytrailcom/MyWebService1.wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    >
    <wsdl:types>
    </wsdl:types>
    <wsdl:message name="MyWebService1_getspecificationbyid">
    <wsdl:part name="pSpecId" type="xsd:decimal"/>
    </wsdl:message>
    <wsdl:message name="MyWebService1_getspecificationbyidResponse">
    *<wsdl:part name="result" type="xsd:string"/>*
    </wsdl:message>
    <wsdl:portType name="MyWebService1">
    <wsdl:operation name="getspecificationbyid" parameterOrder="pSpecId">
    <wsdl:input message="tns:MyWebService1_getspecificationbyid"/>
    <wsdl:output message="tns:MyWebService1_getspecificationbyidResponse"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="MyWebService1" type="tns:MyWebService1">
    <soap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getspecificationbyid">
    <soap:operation soapAction="http://devsafetrytrailcom/MyWebService1.wsdl/getspecificationbyid"/>
    <wsdl:input>
    <soap:body use="literal"
    namespace="http://devsafetrytrailcom/MyWebService1.wsdl"
    parts="pSpecId"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal"
    namespace="http://devsafetrytrailcom/MyWebService1.wsdl"
    parts="result"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="MyWebService1">
    <wsdl:port name="MyWebService1Port" binding="tns:MyWebService1">
    <soap:address location="http://localhost:7101/SafetyTrail-Model-context-root/MyWebService1Port"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Edited by: user592403 on Jul 26, 2010 9:57 AM

    Anyone seen this problem before??

  • Sql query(PL/SQL function body return SQL query) with in(x,y,z) condition

    Hello,
    I've set up a region definition of type "SQL Query(PL/SQL function body return SQL query). In my query I make use of an "in" condition. When I populate :P755_INC_BARG_UNIT with a value of 0F (no quotes), I get the correct count. However, when I set :P755_INC_BARG_UNIT to 0F, 0E I get an invalid count. What do I have to set the page item to?
    When running the query in TOAD, and setting :P755_INC_BARG_UNIT to the string inside the brackets (0F, 0E) I get the proper count.
    The code I use is shown below. Any help would be appreciated,
    Alex.
    DECLARE
    v_sql VARCHAR2(32767);
    BEGIN
    SELECT count(*) "cnts",
    ''Faculty data file IDs missing in appt table'' "err_type"
    FROM hradmin.et_faculty_salary fs left outer join
    hradmin.appointments appt
    ON trim(fs.empl_id) = appt.emp_emp
    and appt.ear_activ <> ''Z''
    and appt.ear_type = ''F''
    and (appt.ear_class in (''A'',''B'',''C'',''D''))
    and appt.ear_bargunit in ( :P755_INC_BARG_UNIT )
    WHERE appt.emp_emp is null
    RETURN v_sql;
    END;

    Alex,
    try something like:
    DECLARE
    v_sql VARCHAR2(32767);
    BEGIN
    v_sql := <YOUR_SQL_STATEMENT_WITH_P755_INC_BARG_UNIT_IN_IT>;
    v_sql :=  REPLACE(v_sql, ':P755_INC_BARG_UNIT',:P755_INC_BARG_UNIT);
    RETURN v_sql;
    END; But before doing it read this:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:210612357425
    After reading you will be able to find the best solution yourself.
    Lev

  • SQL functions in TOOL code

     

    In my original email I should have made the point clear that an indexed
    column was required, that led to some confusion, apologies.
    Under Oracle 7 even if the column is indexed the query engine still does a
    full scan of the index to find the maximum or minimum value. As strange as
    this seems it is possible to view it using the Oracle trace functions such
    as tkprof. This method is quicker than not having an index but the cursor
    method is far more efficient.
    When using a cursor based approach Oracle will go straight to the first
    record of the index (depending on MAX or MIN) and retrieve the data. By
    exiting at that point the function has been performed and the I/O operations
    are extremely low compared to a full index scan.
    Of course there is a trade off depending on the amount of rows but for large
    indexed tables the cursor approach will be far faster than the normal
    functions. I'm not sure how other RDBMS's handle MAX/MIN but this has been
    my experience with Oracle. This process may be faster still by using PL/SQL
    but then you are incorporating specific database languages which is
    obviously a problem if you port to a different RDBMS. Here is some code you
    can try for Oracle PL/SQL functions:
    declare
    cursor myCur1 is
    select number_field
    from number_table
    order by number_field desc;
    begin
    open myCur1;
    fetch myCur1 into :max_val;
    close myCur1;
    end;
    I hope this clarifies things a bit more. If in doubt of the execution plan
    of a performance critical query use the database trace functions as they
    show up all sorts of surprises. MAX and MIN are easy to understand when
    viewing code but perform poorly under Oracle, whether v8 behaves differently
    I have yet to discover.
    Cheers,
    Dylan.
    -----Original Message-----
    From: [email protected] [mailto:[email protected]]
    Sent: Thursday, 7 January 1999 3:37
    To: [email protected]
    Subject: RE: SQL functions in TOOL code
    I guess my point is that MAX can always be implemented more
    efficiently than the SORT/ORDER-BY approach (but may not be the
    case, depending on the RDBMS). If an ORDER-BY
    can use an index (which means that the indexing mechanism involves
    a sorted collection rather than an unordered hashtable) so can
    MAX - in which case finding a MAX value could be implemented
    in either O(1) or O(logn) time, depending on the implementation.
    The last sentence being the major point of this whole discussion,
    which is that your mileage may vary depending on the RDBMS - so
    try using both approaches if performance is a problem.
    In terms of maintenance, MAX is the much more intuitive approach
    (In My Opinion, of course), since a programmer can tell right away
    what the code is attempting to do.
    Chad Stansbury
    BORN Information Services, Inc.
    -----Original Message-----
    From: [email protected]
    To: [email protected]; [email protected]; [email protected]
    Sent: 1/6/99 10:45 AM
    Subject: RE: SQL functions in TOOL code
    Well, yes, but in that specific case (looking for max() value) would not
    be
    true that, if you have an index (and only then) on that specific column
    some
    databases (like Oracle) will be smart enough to use index and find max
    value
    without full table scan and without using order by clause?
    Dariusz Rakowicz
    Consultant
    BORN Information Services (http://www.born.com)
    8101 E. Prentice Ave, Suite 310
    Englewood, CO 80111
    303-846-8273
    [email protected]
    -----Original Message-----
    From: Sycamore [SMTP:[email protected]]
    Sent: Wednesday, January 06, 1999 10:29 AM
    To: [email protected]; [email protected]
    Subject: Re: SQL functions in TOOL code
    If (and only if) an index exists on the exact columns in the ORDER BY
    clause, some databases are smart enough to traverse the index (inforward
    or
    reverse order) instead of doing a table scan followed by a sort.
    If there is no appropriate index, you always end up with some kind ofsort
    step.
    Of course this is all highly schema- and database-dependent, so youmust
    weigh those factors when deciding to exploit this behavior.
    Kevin Klein
    Sycamore Group, LLC
    Milwaukee
    -----Original Message-----
    From: [email protected] <[email protected]>
    To: [email protected] <[email protected]>
    Date: Wednesday, January 06, 1999 9:40 AM
    Subject: RE: SQL functions in TOOL code
    This seems a bit counter-intuitive to me... primarily due to
    the fact that both MAX and ORDER-BY functionality would require
    a full table scan on the given column... no? However, I would
    think that a MAX can be implemented more efficiently since it
    just requires the max value in a given set (which can be performed
    in O(n) time on an unordered set) versus an ORDER-BY (sort)
    performance on an unordered set of at best O(nlogn) time.
    Am I missing something? Please set me straight on this 'un.
    Chad Stansbury
    BORN Information Services, Inc.
    -----Original Message-----
    From: Jones, Dylan
    To: 'Vuong, Van'
    Cc: [email protected]
    Sent: 1/5/99 4:42 PM
    Subject: RE: SQL functions in TOOL code
    Hi Van,
    Operating a function such as MAX or MIN is possible as given in your
    example
    but it is worth pointing out the performance overhead with such a
    method.
    When you use MAX, Oracle will do a full table scan of the column so
    if
    you
    have a great many rows it is very inefficient.
    In this case use a cursor based approach and depending on your
    requirments
    (MAX/MIN) use a descending or ascending ORDER BY clause.
    eg.
    begin transaction
    for ( aDate : SomeDateDomain ) in
    sql select DATE_FIELD
    from DATE_TABLE
    order by
    DATE_FIELD DESC
    on session MySessionSO
    do
    found = TRUE;
    aLatestDate.SetValue(aDate);
    // Only bother about the first record
    exit;
    end for;
    end transaction;
    On very large tables the performance increases with the above method
    will be
    considerable so it is worth considering which method to use whensizing
    your
    database and writing your code.
    Cheers,
    Dylan.
    -----Original Message-----
    From: Vuong, Van [mailto:[email protected]]
    Sent: Tuesday, 5 January 1999 6:50
    To: [email protected]
    Subject: SQL functions in TOOL code
    Is it possible to execute a SQL function from TOOL code?
    For example:
    SQL SELECT Max(Version) INTO :MyVersion
    FROM Template_Design
    WHERE Template_Name = :TemplateName
    ON SESSION MySession;
    The function in this example is MAX().
    I am connected to an Oracle database.
    Thanks,
    Van Vuong
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    >
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive<URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Exporting pl/sql functions

    Hi,
    I know how to register PL/SQL functions in discoverer Admin and also how to export a folder or entire EUL from discoverer Admin and then also how to import them back.
    But can someone please tell me how can i export existing pl/sql functions which are registered in Disc Admin to another instance of Disc Admin?
    Thanks in advance.
    --Kumar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Great!!!
    Thanks, I think i missed the Step2.
    --Kumar                                                                                                                                                                                                       

  • Register PL/SQL functions

    Hi,
    I want to use the EXTRACT function in Discoverer. I went through the Help for the «Import PL/SQL function» without success....
    When I click the «Import» button, I see a HUGE list of functions, and I don't recognize which is the one I want.
    I use that EXTRACT in the same database with PL/SQL developer and it works fine, but I get a «Function EXTRACT has not been registered with the EUL» message when I try to use it in Discoverer.
    Any one knows how to «bring» the right function in the EUL ??
    Thanks.

    I was able to import a Oracle standard package function SYS_CONTEXT and view it in Discoverer Desktop/Plus.
    However when I create my own package function in a schema "xxdev" and then import via Disco Admin, I cannot view this function in Discoverer Desktop/Plus. These are the steps that I followed to implement it:
    1. create package in xxdev schema
    2. grant execute on package to noetix_sys & noetix_eul
    3. register the function in Disco Admin
    4. login to Disco Desktop/Plus and try creating a calculation field and lookup functions.
    The function is not visible. I followed the exact same steps for STANDARD.SYS_CONTEXT function and it was visible. Is something missing in my steps to do?
    Thanks in advance.

  • Calling a pl/sql function.

    Hi,
    I couldn't manage to call a pl/sql function that takes some arguments or no arguments.
    I couldn't find an example but searching through previous topics / discussions I could write something like this :
    ExpressionBuilder expBuilder = new ExpressionBuilder();
    Vector args = new Vector();
    Vector parameters = new Vector();
    // dynamically fill these vectors if there are any arguments to the function
    Expression exp = expBuilder.getFunctionWithArguments(functionName, args);
    DataReadQuery query = new DataReadQuery();
    query.setSelectionCriteria(exp);
    Iterator iter = args.iterator();
    while (iter.hasNext())
    query.addArgument((String)iter.next());
    Object obj = getActiveUnitOfWork().executeQuery(query, parameters);
    at the end what I get is NullPointerException, probably I'm missing something.
    UnitOfWork(17384)--#executeQuery(DataReadQuery())
    UnitOfWork(17384)--java.lang.NullPointerExceptionjava.lang.NullPointerException
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.setCallFromStatement(Unknown Source)
         at oracle.toplink.internal.queryframework.StatementQueryMechanism.prepareExecuteSelect(Unknown Source)
         at oracle.toplink.queryframework.DataReadQuery.prepare(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.checkPrepare(Unknown Source)
         at oracle.toplink.queryframework.DatabaseQuery.execute(Unknown Source)
         at oracle.toplink.queryframework.ReadQuery.execute(Unknown Source)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at oracle.toplink.publicinterface.Session.executeQuery(Unknown Source)
         at com.vnu.publitec.axis.toplink.PersistenceProvider.executeStoredProc(PersistenceProvider.java:420)
         at com.vnu.publitec.axis.dispatcher.AxisDispatcherLocalImpl.executeStoredProc(AxisDispatcherLocalImpl.java:280)
         at com.vnu.publitec.axis.dispatcher.AxisSessionBean.executeStoredProc(AxisSessionBean.java:215)
         at AxisSessionBeanRemote_StatefulSessionBeanWrapper0.executeStoredProc(AxisSessionBeanRemote_StatefulSessionBeanWrapper0.java:501)
         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:324)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:119)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:536)

    You must use SQL with DataReadQuery, you cannot use expressions. Since a single value is returned the ValueReadQuery can be used to filter the result.
    Example:
    ValueReadQuery query = new ValueReadQuery("Select My_func(#arg1, #arg2) from dual");
    query.addArgument("arg1");
    query.addArgument("arg2");
    Vector arguments = new Vector(2);
    arguments.add("1");
    arguments.add("2");
    Object result = session.executeQuery(query, arguments);
    or,
    Vector result = session.executeSelectingCall(new SQLCall("select my_func(1, 2) from dual"));

  • ADF 11g : Calling PL Sql Function

    Hi there..
    I am trying to call a PL/SQL Function from my application module in ADF 11g.
    The code looks something like this
        public void getName(int relationNumber) {
            DBTransaction tc = getDBTransaction();
            StringBuffer statement = new StringBuffer("begin ");
            statement.append("? := COMP_RLE.RLE_GET_NAME(?);");
            statement.append("end;");
            OracleCallableStatement cs = (OracleCallableStatement)tc.createCallableStatement(statement.toString(), 0);
            try {
                cs.registerOutParameter(1, Types.VARCHAR);
                cs.setInt(2, relationNumber);
                cs.execute();
                String retValue = cs.getString(1);
                System.out.println(retValue);
            } catch (SQLException e) {
                System.err.println("Something went wrong: " + e.getMessage());
        }When I run this in TOAD I get a result back in the form of a String.
    However when I run the code above in a Unit Test I get back "null".
    Does anybody know what I am doing wrong here?
    Hope someone can help me out here.
    Thanks in advance,
    Gideon

    I think it will probably work that way.. but the thing is.. I have been going over examples.. and they work with the CallableStatement.
    I just want to know how come this isn't working the way it should.
    Did I miss something?
    Examples that I was looking at are:
    <li>http://www.experts-exchange.com/Programming/Languages/Java/Q_24106340.html
    <li>http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jdbc/varray/index.html
    <li>Re: Returning a value from PL/SQL Function in ADF BC
    and
    <li>http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvgen.htm#sm0457
    They all work with the (Oracle)CallableStatement
    Edited by: Gideon Liem on Dec 4, 2009 12:27 AM

  • ORA-06503: PL/SQL: Function returned without value

    Hello
    Having a bit of a problem with piplined functions.
    Why does this work :
    SET SERVEROUTPUT ON
    DECLARE
    TYPE SARRAY IS TABLE OF VARCHAR2(4000);
    CURSOR CU IS SELECT * FROM DX_XML_ATTENDANCE WHERE STUD_ID = 107777 AND BASE_ID = 94;
    T_STUD NUMBER(10);
    T_BASE NUMBER(10);
    T_DATE DATE;
    T_MARKS VARCHAR2(1000);
    LEN_MARKS NUMBER;
    PDATE DATE;
    SDATE DATE;
    EDATE DATE;
    SLEN NUMBER;
    WEEKLEN NUMBER;
    INIPOS NUMBER;
    MARRAY VARCHAR2(1000);
    SUBARRAY SARRAY := SARRAY();
    SFILL VARCHAR2(14) := '--------------';
    EPOS NUMBER;
    MY_REC     DX_XML_ATTENDANCE%ROWTYPE;
    BEGIN
    SUBARRAY.EXTEND(17);
    DBMS_OUTPUT.ENABLE(100000000);
    --FOR MY_REC IN CU
    OPEN CU;
    LOOP
         FETCH CU INTO MY_REC;
         EXIT WHEN (CU%NOTFOUND);
    T_STUD := MY_REC.STUD_ID;
    T_BASE := MY_REC.BASE_ID;
    T_DATE := TO_DATE(MY_REC.START_DATE, 'DD/MM/YYYY');
    T_MARKS := MY_REC.MARKS;
    LEN_MARKS := LENGTH(T_MARKS);
    EPOS := LEN_MARKS / 2;
    SDATE := ROUND(TO_DATE(T_DATE), 'W') - 1;
    INIPOS := TO_NUMBER(TO_CHAR(T_DATE, 'D'));
    SLEN := INIPOS + 3;
    PDATE := SDATE;
    EDATE := SDATE + EPOS;
    MARRAY := SUBSTR(T_MARKS, 1, SLEN);
    WEEKLEN := LENGTH(MARRAY);
    IF WEEKLEN < 14 THEN
         MARRAY := SUBSTR(SFILL, 1, 14 - WEEKLEN) || MARRAY;
    END IF;
    SUBARRAY(1) := T_STUD;
    SUBARRAY(2) := T_BASE;
    SUBARRAY(3) := PDATE;
    FOR i IN 4 .. 17 LOOP
         SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
    END LOOP;
    DBMS_OUTPUT.PUT_LINE(SUBARRAY(1)||' '||SUBARRAY(2)||' '||SUBARRAY(3)||' '||SUBARRAY(4)||' '||
         SUBARRAY(5)||' '||SUBARRAY(6)||' '||SUBARRAY(7)||' '||SUBARRAY(8)||' '||SUBARRAY(9)||' '||
         SUBARRAY(10)||' '||SUBARRAY(11)||' '||SUBARRAY(12)||' '||SUBARRAY(13)||' '||SUBARRAY(14)||' '||
         SUBARRAY(15)||' '||SUBARRAY(16)||' '||SUBARRAY(17));
    WHILE PDATE < EDATE LOOP
         PDATE := PDATE + 7;
         MARRAY := SUBSTR(T_MARKS, SLEN + 1, 14);
         WEEKLEN := LENGTH(MARRAY);
         IF WEEKLEN < 14 THEN
              MARRAY := MARRAY || SUBSTR(SFILL, 1, 14 - WEEKLEN);
         END IF;
         FOR i IN 4 .. 17 LOOP
              SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
         END LOOP;
         SUBARRAY(3) := PDATE;
    DBMS_OUTPUT.PUT_LINE(SUBARRAY(1)||' '||SUBARRAY(2)||' '||SUBARRAY(3)||' '||SUBARRAY(4)||' '||
         SUBARRAY(5)||' '||SUBARRAY(6)||' '||SUBARRAY(7)||' '||SUBARRAY(8)||' '||SUBARRAY(9)||' '||
         SUBARRAY(10)||' '||SUBARRAY(11)||' '||SUBARRAY(12)||' '||SUBARRAY(13)||' '||SUBARRAY(14)||' '||
         SUBARRAY(15)||' '||SUBARRAY(16)||' '||SUBARRAY(17));
         PDATE := PDATE + 7;
         SLEN := SLEN + 14;
    END LOOP;
    END LOOP;
    END;
    and this does not :
    CREATE OR REPLACE PACKAGE BODY PARSE_ATTENDANCE AS
    FUNCTION ENUM_MARKS(SEL_SQL IN VARCHAR2)
    RETURN TMP_ATT_DATA_TBL PIPELINED
    IS
    V_SQL           VARCHAR(1000):= SEL_SQL;
    V_CURSOR      SYS_REFCURSOR;
    V_ROW          TMP_ATT_HOLDING:=TMP_ATT_HOLDING(NULL, NULL, NULL, NULL);
    T_STUD           NUMBER(10);
    T_BASE           NUMBER(10);
    T_DATE           DATE;
    T_MARKS      VARCHAR2(1000);
    LEN_MARKS      NUMBER;
    PDATE          DATE;
    SDATE          DATE;
    EDATE          DATE;
    SLEN           NUMBER;
    WEEKLEN      NUMBER;
    INIPOS           NUMBER;
    MARRAY           VARCHAR2(1000);
    SUBARRAY      SARRAY := SARRAY();
    SFILL           VARCHAR2(14) := '--------------';
    EPOS           NUMBER;
    BEGIN
    SUBARRAY.EXTEND(17);
    OPEN V_CURSOR FOR V_SQL;
    LOOP
         FETCH V_CURSOR INTO V_ROW.STUD_ID, V_ROW.BASE_ID, V_ROW.START_DATE, V_ROW.MARKS;
         EXIT WHEN V_CURSOR%NOTFOUND;
    T_STUD := V_ROW.STUD_ID;
    T_BASE := V_ROW.BASE_ID;
    T_DATE := TO_DATE(V_ROW.START_DATE, 'DD/MM/YYYY');
    T_MARKS := V_ROW.MARKS;
    LEN_MARKS := LENGTH(T_MARKS);
    EPOS := LEN_MARKS / 2;
    SDATE := ROUND(TO_DATE(T_DATE), 'W') - 1;
    INIPOS := TO_NUMBER(TO_CHAR(T_DATE, 'D'));
    SLEN := INIPOS + 3;
    PDATE := SDATE;
    EDATE := SDATE + EPOS;
    MARRAY := SUBSTR(T_MARKS, 1, SLEN);
    WEEKLEN := LENGTH(MARRAY);
    IF WEEKLEN < 14 THEN
         MARRAY := SUBSTR(SFILL, 1, 14 - WEEKLEN) || MARRAY;
    END IF;
    SUBARRAY(1) := T_STUD;
    SUBARRAY(2) := T_BASE;
    SUBARRAY(3) := PDATE;
    FOR i IN 4 .. 17 LOOP
         SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
    END LOOP;
    PIPE ROW(TMP_ATT_DATA_OBJ(SUBARRAY(1),SUBARRAY(2),SUBARRAY(3),SUBARRAY(4),
         SUBARRAY(5),SUBARRAY(6),SUBARRAY(7),SUBARRAY(8),SUBARRAY(9),
         SUBARRAY(10),SUBARRAY(11),SUBARRAY(12),SUBARRAY(13),SUBARRAY(14),
         SUBARRAY(15),SUBARRAY(16),SUBARRAY(17)));
    WHILE PDATE < EDATE LOOP
         PDATE := PDATE + 7;
         MARRAY := SUBSTR(T_MARKS, SLEN + 1, 14);
         WEEKLEN := LENGTH(MARRAY);
         IF WEEKLEN < 14 THEN
              MARRAY := MARRAY || SUBSTR(SFILL, 1, 14 - WEEKLEN);
         END IF;
         FOR i IN 4 .. 17 LOOP
              SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
         END LOOP;
         SUBARRAY(3) := PDATE;
         PIPE ROW(TMP_ATT_DATA_OBJ(SUBARRAY(1),SUBARRAY(2),SUBARRAY(3),SUBARRAY(4),
         SUBARRAY(5),SUBARRAY(6),SUBARRAY(7),SUBARRAY(8),SUBARRAY(9),
         SUBARRAY(10),SUBARRAY(11),SUBARRAY(12),SUBARRAY(13),SUBARRAY(14),
         SUBARRAY(15),SUBARRAY(16),SUBARRAY(17)));
         PDATE := PDATE + 7;
         SLEN := SLEN + 14;
    END LOOP;
    END LOOP;
    END ENUM_MARKS;
    END PARSE_ATTENDANCE;
    (This is then called like SELECT * FROM
    TABLE(
    PARSE_ATTENDANCE.ENUM_MARKS(
    'SELECT STUD_ID, BASE_ID, START_DATE, MARKS
    FROM DX_XML_ATTENDANCE WHERE STUD_ID = 107777
    AND BASE_ID = 94'))
    I get the same error, around this section near the bottom :
         PDATE := PDATE + 7;
         SLEN := SLEN + 14;
    Can any one help?

    Here is an example. you are missing an return statement.
    SQL> create or replace type varchar2_table is table of varchar2(10) ;
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL> create or replace function get_data return varchar2_table pipelined is
      2  begin
      3      pipe row(('Test')) ;
      4  end ;
      5  /
    Function created.
    SQL> show errors
    No errors.
    SQL> select * from table(get_data) ;
    ERROR:
    ORA-06503: PL/SQL: Function returned without value
    ORA-06512: at "KKISHORE.GET_DATA", line 3
    no rows selected
    SQL> create or replace function get_data return varchar2_table pipelined is
      2  begin
      3      pipe row(('Test')) ;
    4 return ;
      5  end ;
      6  /
    Function created.
    SQL> show errors
    No errors.
    SQL> select * from table(get_data) ;
    COLUMN_VAL
    Test
    SQL>

  • SVG multiline chart based on PL/SQL function

    Dear all -
    Having trawled this forum and with a fair bit of experimentation I've concluded that:
    1. Generating an SVG line series using a PL/SQL function returning a SQL statement is perfectly possible;
    BUT
    2. It only works for a single series. Adding further series blanks out the SVG chart area and nothing at all is displayed.
    Can anyone tell me if this is right or am I missing a trick? The usual problems such as ordering, nulls etc. don't apply in this case.
    Thanks for your time.
    John.

    On some, but not all SVG line charts, I had trouble when some values are ZERO.
    Putting a CASE WHEN var = 0 then 0.05 ELSE var END in the select statement
    fixed those situations.
    I had missing lines when the number of data points in a series exceeded the default number of 15, and I did not set in the series configuration to a number equal to or higher that the number of data points in that series.
    And I had one instance, where a couple missing lines reappeared when I exited
    the browser and app completely and restarted the app.
    All these comments apply to ver 1.6x and 2.0x

  • Report- Pl/sql function returning sql query parsing page items as text?

    Hi Team,
    I am facing a strange issue .
    I have four page items namely
    1)JOB_CODE
    2)MIN_EXP
    3) MAX_EXP
    4) SOURCES1
    I have a report of the type "Pl/sql function returning sql query"
    declare
    v_sql varchar2(4000);
    begin
    if (:JOB_CODE IS NOT NULL and :MIN_EXP IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
    v_sql:= 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
    elsif (:JOB_CODE IS NULL and :MIN_EXP IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
    v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
    elsif (:MIN_EXP IS NULL and :JOB_CODE IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
    v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where v_experience_years <= :MAX_EXP and V_REQUIREMENT = :JOB_CODE and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
    elsif (:MAX_EXP is null and :JOB_CODE IS NOT NULL and :MIN_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
    v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
    end if;
    insert into query_list values (v_sql);
    insert into debug values (:JOB_CODE , :MIN_EXP , :MAX_EXP , :SOURCES1);
    return v_sql;
    end;
    Please not that I am insertin the query into a table called Query_list and the page item values into the table called Debug thru the pl/sql function which returns teh query.
    Now I select the data from the debug tables.
    select unique(query) from query_list;
    select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like '%:SOURCES1%'
    select * from debug;
    JOBCODE     MINEX     MAXEX     SOURCE
    21     1     10     donkeyHire
    And if I run the query in sql I get some records returned
    select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = 21 and v_experience_years >= 1 and v_experience_years <= and source like 'donkeyHire'
    V_CANDIDATE_ID     V_FNAME     V_CURRENT_EMPLOYER     V_EXPERIENCE_YEARS
    2     Vengu     Andale Tech     4
    But the record does not show up in the report!
    does this type of report parse page items as text?
    Why is it so?
    Waiting for an early reply.
    Thanks,
    venkat

    Venkat - You don't want to put ':SOURCES1' in quotes like that.
    Scott

  • Passing Multiple Values from a worksheet to PL/SQL function.

    Hi All,
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    I will try to explain the scenario:
    We have a crosstab report that showing all the customer details, deposit sum of a customer in each date in a date range selected. With the customer details we are showing the Rank of a customer based on the deposit in the latest date selected. Filtering is based on the rank, ie Top50 or Top60 etc.( As I said rank is calculating based on the deposit in the latest date).This is working fine.
    Now the new requirement is to : For example, in Top50 report, list all the customers, who were in the Top50 list, in any of the dates selected. We are able to display the daywise rank, but when giving a condition like daywiserank <= 50, the result becomes uncertain. Some blank lines, wrong amounts etc..
    As a work around we tried to find out the rank in a PL/SQL function. But the issue there is : we have some multiple value parameters used in the worksheet.
    Is there any way to pass multiple values selected in a worksheet to a PL/SQL function ?
    Or any other work arounds for the scenario explained?
    Reagrds,
    Jeneesh

    Hi Russ,
    Thanks for the response.
    Russ Proudman wrote:
    1. I thought there was an analytical function similar to rank - or maybe an option of rank - that if there are duplicate records to have them all considered the same rank. So if you had 3 records all the same as rank=2 then a condition saying where rank=2 would return the 3 records. You could check into this.
    We are already using DENSE_RANK. But the issue is the output contains incorrect null values nd repeated rows.
    We got it solved as I explained in the previous post. But will that AGGREGATION MODE setting ( Which discoverer says - not recommended) have any issue? I mean side effects?
    Russ Proudman wrote:
    2. Another thought is that you can create a PL/SQL routine - that's called from a SQL function registered in Discoverer - where a table is created that does the first part of your query. Then a worksheet is created to use the data from that table. So, in essence, the table would have your top50 ranked customers. Then you can write any kind of worksheet against that table. However, DBAs are loath to allow tables - that they didn't create! - many times in a PROD environment.
    Here also the same problem will occur: as the top 50 will depend upon the parameters. I cannot pass those parameters to PL/SQL Function.And storing the top50 ( itmay be top100 or to 150 also) for all combinations of the parameters is impossible
    Russ Proudman wrote:
    3. Finally, are you sure you're rank function is correct in that if you're getting blank lines, maybe the 'over' part is not considering all columns needed to determine the rank?
    Yes the query we are using is correct. The output QUERY of discoverer gives correct results in Sqlplus.
    Regards,
    Jeneesh

Maybe you are looking for