GGobi fails to compile, wrong function calls in graphviz.c

Hi there,
I'm having troubles to makepkg ggobi, where make fails due to the below pasted errors.
I am on a 64-bit system (a MacBook I put Arch on), not sure if that is relevant.
Does anyone have an idea what is wrong here?
Thanks,
Alex
graphviz.c: In function 'dot_neato_layout_cb':
graphviz.c:215:3: error: too few arguments to function 'aginit'
aginit();
^
In file included from /usr/include/graphviz/types.h:49:0,
from /usr/include/graphviz/gvc.h:17,
from graphviz.c:16:
/usr/include/graphviz/cgraph.h:359:13: note: declared here
extern void aginit(Agraph_t * g, int kind, char *rec_name, int rec_size,
^
graphviz.c:220:3: error: incompatible type for argument 2 of 'agopen'
graph = agopen("graph", kind);
^
In file included from /usr/include/graphviz/types.h:49:0,
from /usr/include/graphviz/gvc.h:17,
from graphviz.c:16:
/usr/include/graphviz/cgraph.h:266:18: note: expected 'Agdesc_t' but argument is of type 'gint'
extern Agraph_t *agopen(char *name, Agdesc_t desc, Agdisc_t * disc);
^
graphviz.c:220:3: error: too few arguments to function 'agopen'
graph = agopen("graph", kind);
^
In file included from /usr/include/graphviz/types.h:49:0,
from /usr/include/graphviz/gvc.h:17,
from graphviz.c:16:
/usr/include/graphviz/cgraph.h:266:18: note: declared here
extern Agraph_t *agopen(char *name, Agdesc_t desc, Agdisc_t * disc);
^
graphviz.c:226:5: error: too few arguments to function 'agnode'
agnode(graph, name);
^
In file included from /usr/include/graphviz/types.h:49:0,
from /usr/include/graphviz/gvc.h:17,
from graphviz.c:16:
/usr/include/graphviz/cgraph.h:280:18: note: declared here
extern Agnode_t *agnode(Agraph_t * g, char *name, int createflag);
^
graphviz.c:248:7: error: too few arguments to function 'agedge'
edge = agedge(graph, tail, head);
^
In file included from /usr/include/graphviz/types.h:49:0,
from /usr/include/graphviz/gvc.h:17,
from graphviz.c:16:
/usr/include/graphviz/cgraph.h:291:18: note: declared here
extern Agedge_t *agedge(Agraph_t * g, Agnode_t * t, Agnode_t * h,
^
graphviz.c:285:36: error: 'Agnode_t' has no member named 'name'
agsafeset (graph, "root", ctr->name, NULL);
^
graphviz.c:315:13: warning: assignment makes pointer from integer without a cast [enabled by default]
sym = agfindattr(graph,"dim");
^
graphviz.c:317:15: warning: assignment makes pointer from integer without a cast [enabled by default]
sym = agraphattr(graph,"dim","");
^
graphviz.c:319:26: error: 'attrsym_t' has no member named 'index'
agxset(graph, sym->index, buf);
^
graphviz.c:354:11: error: 'Agnode_t' has no member named 'u'
node->u.width = node->u.height = .001;
^
graphviz.c:354:27: error: 'Agnode_t' has no member named 'u'
node->u.width = node->u.height = .001;
^
Makefile:393: recipe for target 'plugin_la-graphviz.lo' failed
make[3]: *** [plugin_la-graphviz.lo] Error 1

>
Suns "http://developers.sun.com/sunstudio/documentation/ss12/whatsnew.html" says :
Support for the following open-source libraries:
BOOST http://www.boost.org
Boost 1.34.1 should work OK. I haven't tried Boost 1.35 yet.
The above code snippet is picked from "boost/boost_1_35_0/boost/interprocess/detail/algorithms.hpp" line number 65.
Any Suggestions or work arounds??+
The above Suns link also says:
Complex expressions in template parameters.
The compiler was previously unable to handle expressions in non-type template arguments in certain cases.
I did not use any compilation flag, am I missing something?
Make sure that you compile and link with -library=stlport4, otherwise you will be limited in the Boost libraries that you will be able to use.
Paul

Similar Messages

  • SunStudio 12 Fails to compile template function with template argument

    Hi
    Look at the code below:
    #include <iostream>
    template<class InIt, class OutIt>
    InIt copy_n(InIt first,  typename  std::iterator_traits<InIt>::difference_type  length, OutIt dest)
       for (;length--; ++dest, ++first)
          *dest = *first;
       return first;
    int main()
            char str1[]="Sumit";
            char str2[20];
            copy_n(str1,6,str2);
            std::cout << str2;
            return 0;
    }I have simplified this to pin point the problem, This code dosent compile with SunStudio12 C++ Compiler, (however this works fine on g++ and vc++). The problem is with second parameter
    typename std::iterator_traits<InIt>::difference_type  lengthinstead if we specify any simple type as below, it works fine
    int lengthSuns "http://developers.sun.com/sunstudio/documentation/ss12/whatsnew.html" says :
    Support for the following open-source libraries:
    BOOST http://www.boost.org
    The above code snippet is picked from "boost/boost_1_35_0/boost/interprocess/detail/algorithms.hpp" line number 65.
    Any Suggestions or work arounds??+
    The above Suns link also says:
    Complex expressions in template parameters.
    The compiler was previously unable to handle expressions in non-type template arguments in certain cases.
    I did not use any compilation flag, am I missing something?
    Edited by: sumitkumar on May 20, 2008 12:20 PM
    Edited by: sumitkumar on May 20, 2008 12:25 PM
    Edited by: sumitkumar on May 20, 2008 12:25 PM

    >
    Suns "http://developers.sun.com/sunstudio/documentation/ss12/whatsnew.html" says :
    Support for the following open-source libraries:
    BOOST http://www.boost.org
    Boost 1.34.1 should work OK. I haven't tried Boost 1.35 yet.
    The above code snippet is picked from "boost/boost_1_35_0/boost/interprocess/detail/algorithms.hpp" line number 65.
    Any Suggestions or work arounds??+
    The above Suns link also says:
    Complex expressions in template parameters.
    The compiler was previously unable to handle expressions in non-type template arguments in certain cases.
    I did not use any compilation flag, am I missing something?
    Make sure that you compile and link with -library=stlport4, otherwise you will be limited in the Boost libraries that you will be able to use.
    Paul

  • Recursive calls by JSP tag files fail to compile

    We're hitting an issue with recursive calls in JSP tag files. I found one unanswered post in the General forum - [Tag Files used recursivily throws exception|https://forums.oracle.com/forums/thread.jspa?threadID=853300] - and was wondering if anyone else has hit this or knows of any work-arounds/patches or knows how to raise suspected bugs with Oracle (when you don't have an official support relationship for WebLogic)?
    Example tag file - /WEB-INF/tags/recurse/hello.tag:
    <%@ tag body-content="empty" %>
    <%@ attribute name="name" required="true" type="java.lang.String"%>
    <%@ attribute name="depth" required="true" type="java.lang.Number"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="r" uri="/WEB-INF/tags/recurse/recurse.tld" %>
    <table border="1" cellpadding="3" cellspacing="3">
    <tr>
    <td>
    Hello ${name} [${depth}]
    </td>
    <c:if test="${depth > 1}">
    <td>
    <r:hello name="${name}" depth="${depth-1}"/>
    </td>
    </c:if>
    </tr>
    </table>
    Example tld file - /WEB-INF/tags/recurse/recurse.tld:
    <?xml version="1.0" encoding="UTF-8" ?>
    <taglib xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
    version="2.1">
    <description>Library with Recursive tag</description>
    <tlib-version>1.0</tlib-version>
    <shortname>r</shortname>
    <tag-file>
    <name>hello</name>
    <path>/WEB-INF/tags/recurse/hello.tag</path>
    </tag-file>
    </taglib>
    Example jsp file - /recurse/test.jsp:
    <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="r" uri="/WEB-INF/tags/recurse/recurse.tld" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Recursive Tag-file Test</title>
    </head>
    <body>
    <c:set var="name" value="${pageContext.request.remoteUser}"/>
    <c:set var="depth" value="${5}"/>
    <p>Welcome ${name}, here are ${depth} greetings</p>
    <r:hello name="${name}" depth="${depth}"/>
    </body>
    </html>
    The expected result from this example would be to get nested 5 HTML tables.
    The current behaviour, is the following is shown on screen when loading the test.jsp:
    Compilation of JSP File '/recurse/test.jsp' failed:
    hello.tag:15:6: Current file's JSP version conflicts with current tag "r:hello"'s.
                        <r:hello name="${name}" depth="${depth-1}"/>
    ^-----^
    hello.tag:15:6: Current file's JSP version conflicts with current tag "r:hello"'s.
                        <r:hello name="${name}" depth="${depth-1}"/>
    ^-----^
    I believe the "JSP version conflicts with current tag" message is misleading (you also get the same error referring to the tag file's folder via a tagdir reference from the JSP and defining an 'implicit.tld' which declares version="2.1"). If you take the recursive <r:hello .../> call out of hello.tag the JSP and tag file compile and function fine. I tried the work around mentioned in the forum post mentioned above, taking the recursive call out, deploying, then putting the recursive tag call back in and just updating the tag file doesn't seem to work for me.
    Using "weblogic.appc" you get a few more messages, though the issue is the same - tag file doesn't compile:
    test.jsp:15:6: The tag handler class was not found "jsp_servlet._tags._recurse.__hello_tag".
    <r:hello name="${name}" depth="${depth}"/>
    ^-----^
    test.jsp:15:14: This attribute is not recognized.
    <r:hello name="${name}" depth="${depth}"/>
    ^--^
    test.jsp:15:29: This attribute is not recognized.
    <r:hello name="${name}" depth="${depth}"/>
    ^---^
    hello.tag:15:6: The tag handler class was not found "jsp_servlet._tags._recurse.__hello_tag".
    <r:hello name="${name}" depth="${depth-1}"/>
    ^-----^
    hello.tag:15:6: Current file's JSP version conflicts with current tag "r:hello"'s.
    <r:hello name="${name}" depth="${depth-1}"/>
    ^-----^
    Happy to send this example as an ear/war for anyone that's interested.
    At this stage, WebLogic seems to be the only servlet container with this limitation.
    This has been tested with WebLogic 10.3.3.0 and 12.1.1.0.
    The context for this is that the issue is present in a (larger) enterprise application. The above simple example with recursive tags is what we have isolated as the problem.
    Although I/we may not have a support relationship for WebLogic, our clients will, so if the solution is apply an already existing patch that solution would be acceptable.

    Somethings definitely wrong with your gcc installation.
    Which gcc are you using. What output do you get from "which gcc".
    Solaris 10 ships with a gcc in /usr/sfw/bin.
    If your using a 3rd party gcc try changing your path to put /usr/sfw/bin before whereever the 3rd party gcc lives. Or just uninstall it.

  • RFC call ended with "Communication Failure" exception (Function call failed; could not find the function

    Hi All,
    I am getting error while executing oDATA service from SAP Netweaver Gateway
    Error details:
    RFC call ended with "Communication Failure" exception (Function call failed; could not find the function
    I am using SAP NG 740
    Project is created in Gateway system using SEGW having Map to Datasource option used.
    in SPRO manage alias, I had seleted Local App option. Screen attached
    I had tried all troubleshooting like delete and add service and alias in "/IWFND_MAINT_SERVICE".
    but still getting same error for all service.
    Kindly advise.
    Regards
    Vivek

    Hello Vivek,
    Service builder would have also generated code for RFC Exception handling to catch exceptions raised when communication fails between your GW and BE for some reasons.
    Handling is done for 1. System Failure 2. Communication Failure & 3. Business Failure;
    Put a BP in your DPC or DP_EXT class where exception code is written to check what exactly is has caused communication failure.
    Check if that RFC is existing in that destination or not.
    For your reference  : Code would be something like this. Put BP here and check the problem.
    * Error and exception handling
    IF lv_subrc <> 0.
    * Execute the RFC exception handling process
       me->/iwbep/if_sb_dpc_comm_services~rfc_exception_handling(
         EXPORTING
           iv_subrc            = lv_subrc
           iv_exp_message_text = lv_exc_msg ).
    ENDIF.
    Go inside this method and check to get info on what has to be done to resolve issue.
    Check carefully what has gone wrong and fix it accordingly.
    No need of adding service & deleting as problem is not because of that.
    Regards,
    Ashwin

  • The Cluster Service function call 'ClusterResourceControl' failed with error code '1008(An attempt was made to reference a token that does not exist.)' while verifying the file path. Verify that your failover cluster is configured properly.

    I am experiencing this error with one of our cluster environment. Can anyone help me in this issue.
    The Cluster Service function call 'ClusterResourceControl' failed with error code '1008(An attempt was made to reference a token that does not exist.)' while verifying the file path. Verify that your failover cluster is configured properly.
    Thanks,
    Venu S.
    Venugopal S ----------------------------------------------------------- Please click the Mark as Answer button if a post solves your problem!

    Hi Venu S,
    Based on my research, you might encounter a known issue, please try the hotfix in this KB:
    http://support.microsoft.com/kb/928385
    Meanwhile since there is less information about this issue, before further investigation, please provide us the following information:
    The version of Windows Server you are using
    The result of SELECT @@VERSION
    The scenario when you get this error
    If anything is unclear, please let me know.
    Regards,
    Tom Li

  • Function call SALI_MT_GET_TID_BY_NAME failed

    All,
    We have the Central System Monitoring set up on the SOM to monitor Red Alerts. There is a current Red Alert associated with Log Attributes under the following path:
    SOM\CCMS database self-monitoring\...
        Database self-monitoring
            SQL Server 
    Red Alert:
    create_mss_space_mgmt: function call SALI_MT_GET_TID_BY_NAME failed with exception NAME_NOT_FOUND. Affected MTE: ., Red 28.04.2007 , 10:02:18 ( No value has yet been reported )
    I would greatly appreciate if you can provide me a solution to correct this Red Alert.
    Thank you very much in advance.

    Dear Dilanka,
    Kindly reset the node using RZ20 :
    Transaction code RZ20
    ====>  SAP CCMS Technical Expert Monitors
       ====>System / All Monitoring Segments / All Monitoring Contexts
         ====>CCMS database self-monitoring
           ====>Database self-monitoring
    ********check the box for Oracle with a tick*********
    **********Go to Extras on the Menu bar *******
       ====>Activate maintenance function
             ====>Edit  ====>  Nodes Reset  <===
    This should normally resolve the issue.
    Regards
    Amit Devale

  • Validation of recursive function call fails

    We want to use a call to a recursive function from a HTMLDB application. It should be used in a page region to generate a query string ("PL/SQL function body returning SQL query"). Everything works fine with a call to a non-recursive function. The recursive function also works fine when called from SQL+.
    After pressing "Apply changes" on "HTML DB Home>Builder - Application 148>Page Definition>Edit Page Region"-page I get the following error message after a long delay:
    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-00600: internal error code, arguments: [kohdtf048], [], [], [], [], [], [], [])
    I assume that the validation routine follows the recursion until the memory limit is reached.
    Please give me a hint how to solve this problem.
    DB version: 10.1.0.2.0
    HTMLDB version: 1.5.0.00.33
    running on Win2000 server

    Since the original function is confidential, I have created a simple one showing the same behavior (and the same error). Termination does not depend on session state:
    Called function (to replace spaces with #):
    create or replace function MF_Test
         p_querystring     varchar2     
         return varchar2 is
         v_position integer;
    begin
         v_position:=instr(p_querystring,' ');
         if v_position=0 then     /* termination condition */
              return p_querystring;
         else
              return substr(p_querystring,1,v_position-1)||'#'||MF_Test(substr(p_querystring,v_position+1));
         end if;
    end MF_Test;
    calling function (from the page region, to generate a query string):
    declare
    q varchar2(500);
    begin
    q:='select * from hardware where model=''';
    q:=q||mf_test(:P3_SEARCH);
    q:=q||'''';
    end
    Validation seems not to terminate in case of recursive function calls.
    Thanks for your input.

  • Authentication failed while using the function from JSP.

    I am facing a issue with the mail functionality with JAVA Mailing.The problem is that when I am running the stand alone program it is working fine but when same function is called from a JSP it gives Authentication failed Exception.I am attaching the code with the case.testMail() Is the function called from the JSP.
    Please Look in to the issue its urgent.
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
    import javax.activation.DataHandler;
    import javax.mail.MessagingException;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    import javax.mail.internet.MimePartDataSource;
    To use this program, change values for the following three constants,
    SMTP_HOST_NAME -- Has your SMTP Host Name
    SMTP_AUTH_USER -- Has your SMTP Authentication UserName
    SMTP_AUTH_PWD -- Has your SMTP Authentication Password
    Next change values for fields
    emailMsgTxt -- Message Text for the Email
    emailSubjectTxt -- Subject for email
    emailFromAddress -- Email Address whose name will appears as "from" address
    Next change value for "emailList".
    This String array has List of all Email Addresses to Email Email needs to be sent to.
    Next to run the program, execute it as follows,
    SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
    private static final String SMTP_HOST_NAME = "host";
    private static final String SMTP_AUTH_USER = "username";
    private static final String SMTP_AUTH_PWD = "password";
    private static final String emailMsgTxt = "Test Msg";
    private static final String emailSubjectTxt = "Notification: New User created";
    private static final String emailFromAddress = "[email protected]";
    // Add List of Email address to who email needs to be sent to
    private static final String[] emailList = {"[email protected]"};
    public static void main(String args[]) throws Exception
    SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
    smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
    System.out.println("Sucessfully Sent mail to All Users");
    public void testMail(String msgBody,String senderEmail)throws MessagingException
    try{
         String mailBody = msgBody;
         String senderEmailAdd = senderEmail;
         SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
         smtpMailSender.postMail( emailList, emailSubjectTxt, mailBody , senderEmail);
         catch(MessagingException me) {
                   //System.out.println("Mail not sent");
                   throw me;
    public void postMail( String recipients[ ], String subject,
    String message , String from) throws MessagingException
    try{
         boolean debug = false;
    //Set the host smtp address
    Properties props = System.getProperties();
    props.put("mail.smtp.host", SMTP_HOST_NAME);
    props.put("mail.smtp.auth", "true");
    Authenticator auth = new SMTPAuthenticator();
    Session session = Session.getInstance(props, auth);
    session.setDebug(debug);
    // create a message
    Message msg = new MimeMessage(session);
    // set the from and to address
    InternetAddress addressFrom = new InternetAddress(from);
    msg.setFrom(addressFrom);
    InternetAddress[] addressTo = new InternetAddress[recipients.length];
    for (int i = 0; i < recipients.length; i++)
    addressTo[i] = new InternetAddress(recipients);
    msg.setRecipients(Message.RecipientType.TO, addressTo);
    // Setting the Subject and Content Type
    msg.setSubject(subject);
    msg.setContent(message, "text/plain");
    Transport.send(msg);
         catch(MessagingException me) {
                   //System.out.println("Mail not sent");
                   throw me;
    * SimpleAuthenticator is used to do simple authentication
    * when the SMTP server requires it.
    public static class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
              return new PasswordAuthentication(username, password);

    Your code doesn't work in stand alone program... just little mistake!
    Miss port property :
    props.put("mail.smtp.port", "25");
    props.put("mail.smtp.starttls.enable", "true"); // tls for gmail
    AddressTo method didn' t compile :
    InternetAddress[] addressTo = new InternetAddress[recipients.length];
    for (int i = 0; i < recipients.length; i++)
         addressTo[i] = new InternetAddress((String) recipients);
    msg.setRecipients(Message.RecipientType.TO, addressTo);
    And see this post for jsp integration :
    http://forum.java.sun.com/thread.jspa?threadID=5184860&tstart=0

  • Function call in FormCalc

    I am trying to call a function (type4) from within a FormCalc exit event:
    if ($.rawValue <> "2") then
         type4.validate()
    endif
    But when I run the form, I get an error saying that the "script does not have a method 'validate'."
    My function definitely does have a method called 'validate', see below:
    function validate() {
    Can anyone help me identify what I'm doing wrong? Thanks for your help.
    --Bruce

    Hi,
    I beleive validate() is a reserved method, so you should rename your function into validateObj() or so.
    And when calling a function, the syntax looks like:
    if ($.rawValue <> "2") then
         validateObj()
    endif
    In contrast to JavaScript FormCalc can only call functions which have been declared before the function call.
    Just an example.
    This script works, because the function is declared before it's called.
    func alert(msg) do
              $host.messageBox(msg)
    endfunc
    if ($ < 2) then
              alert("value to small")
    else
              alert("value ok")
    endif
    but this script fails, because the function call points to a function which has not be declared yet.
    if ($ < 2) then
              alert("value to small")
    else
              alert("value ok")
    endif
    func alert(msg) do
      $host.messageBox(msg)
    endfunc

  • 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • The order of execution (of PL/SQL function calls) changes...why??

    select e.EMPID empid,
    e.name name,
    aatest.SETVALUES(2) z,
    aatest.TEST1() b,
    aatest.TEST2() x,
    aatest.TEST3() y
    from emp e
    where e.empid = 101
    order by e.name;
    when I execute this select statement...the order of function calls is as follows:
    setvalues 1st (call no:1)
    test1 (call no:2)
    test2 (call no:3)
    test3 (call no:4)
    Now...I introduce a join between the two tacles as mentioned in the query
    select e.EMPID empid,
    e.name name,
    e2.deptno deptid,
    aatest.SETVALUES(2) z,
    aatest.TEST1() b,
    aatest.TEST2() x,
    aatest.TEST3() y
    from emp e, emp2 e2
    where e.empid = e2.empid
    order by e.name;
    The order of execution of function calls changes to
    (I observed this using DBMS_OUTPUT.PUT_LINE)
    test3 (call no:1)
    setvalues 1st (call no:2)
    test1 (call no:3)
    test2 (call no:4) (the first and last calls swap!)
    i.e: it calls the last function in the select statement at the beginning
    instead of calling it at the last. Is it the normal behaviour? or whats going on
    here?
    Can somebody explain me, please....
    Details:
    the following four functions are defined in a package called 'aatest' and compiled.
    aatest.SETVALUES(2)
    aatest.TEST1()
    aatest.TEST2()
    aatest.TEST3()
    the Tables EMP and EMP2 are two tables defined in the same schema.

    Your "thinking" is wrong here. You can not use the column order to model your program flow. As SQL is set/tupel based, there is no given sequence of the execution order. Otoh you want to have a specific order in wich your functions must be executed otherwise the result will be wrong (or undefined). Thus here you need a procedural approach. This can be done by using PL/SQL for example.
    You would code your functions in that way, that they are working correctly independent from the place where they are called ie if function1 needs the setvalues function, this function must be called inside the function1 then.
    Are you sure you need all these functions in this procedural approach inside the sql-statement? This is mostly not needed and can be accomplished by using pure SQL. If not, may be your design is broken.

  • Package interpeting function call as variable call

    When I try to compile my package the compiler mistakes the function calls in this collection for variables.:
    type dayonelist IS TABLE OF NUMBER;
    dayone dayonelist := dayonelist(wkdaysminusone(), sadaysminusone(), sudaysminusone());
    I get this error message:
    Error(244,35): PLS-00306: wrong number or types of arguments in call to 'WKDAYSMINUSONE'
    Anyone know how I can correct this?

    rthakur-
    I'm a beginner at this and looking for help and not smart comments. I may not have your experience but I have a little more courtesy than you. Here's the package code:
    CREATE OR REPLACE
    package accessreports is
    vc_FirstofMonth DATE;
    vc_CurrentPick date;
    PROCEDURE PICK_DATE
    (p_first_of_month IN DATE);
    PROCEDURE EXEC_REPORTS(p_first_of_month IN DATE);
    PROCEDURE PRODUCTIVITY_INSERT
    (p_first_of_month IN DATE);
    PROCEDURE AVERAGE_BOARDINGS
    (p_first_of_month IN DATE);
    end accessreports;
    CREATE OR REPLACE PACKAGE BODY accessreports IS
    /*Below are all functions that provide variables for calulations and WHERE
    clauses. All functions are at the top of the package for visibility to all procs and
    convenience*/
    FUNCTION curpick RETURN DATE IS p_current_pick DATE;
    BEGIN
    SELECT MAX(pick) AS
    pick
    INTO p_current_pick
    FROM bus_picks;
    RETURN p_current_pick;
    END curpick;
    FUNCTION wkdays(p_first_of_month IN DATE)
    RETURN NUMBER IS p_wk NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(service_date) AS
    wk
    INTO p_wk
    FROM
    (SELECT DISTINCT service_date
    FROM bus_daily_rides
    WHERE to_char(service_date,'MM-YYYY') = to_char(vc_firstofmonth,'MM-YYYY')
    AND day_type = 'W')
    RETURN p_wk;
    END wkdays;
    FUNCTION sadays (p_first_of_month IN DATE)
    RETURN NUMBER IS p_sa NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(service_date) AS
    sa
    INTO p_sa
    FROM
    (SELECT DISTINCT service_date
    FROM bus_daily_rides
    WHERE to_char(service_date, 'MM-YYYY') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'A')
    RETURN p_sa;
    END sadays;
    FUNCTION sudays(p_first_of_month IN DATE)
    RETURN NUMBER IS p_su NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(service_date) AS
    su
    INTO p_su
    FROM
    (SELECT DISTINCT service_date
    FROM bus_daily_rides
    WHERE to_char(service_date, 'MM-YYYY') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'U')
    RETURN p_su;
    END sudays;
    FUNCTION wkdaysminusone(p_first_of_month IN DATE)
    RETURN NUMBER IS p_wkone NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    wkone
    INTO p_wkone
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -12), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'W')
    RETURN p_wkone;
    END wkdaysminusone;
    FUNCTION sadaysminusone(p_first_of_month IN DATE)
    RETURN NUMBER IS p_saone NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    saone
    INTO p_saone
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -24), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'A')
    RETURN p_saone;
    END sadaysminusone;
    FUNCTION sudaysminusone(p_first_of_month IN DATE)
    RETURN NUMBER IS p_suone NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    suone
    INTO p_suone
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -12), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'U')
    RETURN p_suone;
    END sudaysminusone;
    FUNCTION wkdaysminustwo(p_first_of_month IN DATE)
    RETURN NUMBER IS p_wktwo NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    wktwo
    INTO p_wktwo
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -24), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_FirstofMonth, 'MM-YYYY')
    AND day_type = 'W')
    RETURN p_wktwo;
    END wkdaysminustwo;
    FUNCTION sadaysminustwo(p_first_of_month IN DATE)
    RETURN NUMBER IS p_satwo NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    satwo
    INTO p_satwo
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -24), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'A')
    RETURN p_satwo;
    END sadaysminustwo;
    FUNCTION sudaysminustwo(p_first_of_month IN DATE)
    RETURN NUMBER IS p_sutwo NUMBER;
    BEGIN
    vc_FirstofMonth := p_first_of_month;
    SELECT COUNT(*) AS
    sutwo
    INTO p_sutwo
    FROM
    (SELECT DISTINCT to_char(add_months(service_date, -24), 'dd-mm-yyyy')
    FROM bus_daily_rides
    WHERE to_char(service_date, 'mm-yyyy') = to_char(vc_firstofmonth, 'MM-YYYY')
    AND day_type = 'U')
    RETURN p_sutwo;
    END sudaysminustwo;
    /*PICK_DATE determines if the report being provided takes place during a pick month.*/
    PROCEDURE pick_date(p_first_of_month IN DATE)
    AS
    BEGIN
    vc_firstofmonth := p_first_of_month;
    vc_currentpick := curpick();
    IF to_char(vc_firstofmonth, 'MM-YYYY') <> to_char(vc_currentpick, 'MM-YYYY') THEN
    accessreports.exec_reports(p_first_of_month);
    ELSE
    NULL;
    /*This procedure being built*/
    END IF;
    END pick_date;
    /*EXEC_REPORTS executes the procs below it with two input vars.*/
    PROCEDURE exec_reports(p_first_of_month IN DATE)
    IS
    BEGIN
    accessreports.productivity_insert(p_first_of_month);
    accessreports.average_boardings(p_first_of_month);
    END;
    /*Last two procs use dynamic SQL to rotate through the different day types and
    pls_integer of days for each day type.*/
    PROCEDURE productivity_insert(p_first_of_month DATE)
    AS
    TYPE daylist IS TABLE OF VARCHAR2(1);
    DAYS daylist := daylist('W', 'A', 'U');
    TYPE countlist IS TABLE OF NUMBER;
    counts countlist := countlist(wkdays(), sadays(), sudays());
    BEGIN
    FOR i IN 1 .. 3 LOOP
    EXECUTE IMMEDIATE 'INSERT INTO RFC_BUS' || DAYS(i) || 'PRODUCTIVITY(ROUTE,PPPH)
    SELECT a.route, ((sr05 / sy05)/' || counts(i) || ') AS "RATIO"
    FROM (SELECT route,
    SUM (DECODE (TO_CHAR (pick, "MM-YYYY"),
    to_char(vc_FirstofMonth, "MM-YYYY"), platform_hours, null)) AS sy05
    FROM bus_platformhours
    WHERE day_type =' || DAYS(i) || ' and platform_hours > 0
    GROUP BY route) a,
    (SELECT route,
    SUM (DECODE (TO_CHAR (service_date, "mm-yyyy"),
    to_char(vc_FirstofMonth, "MM-YYYY"), rides, null)) AS sr05
    FROM bush_daily_rides
    WHERE day_type = ' || DAYS(i) || 'GROUP BY route) b
    WHERE a.route = b.route
    ORDER BY a.route
    VALUES(
    p_route,
    p_ratio
    ) USING days(i), counts(i)';
    END LOOP;
    END productivity_insert;
    PROCEDURE average_boardings(p_first_of_month DATE)
    AS
    type daylist IS TABLE OF VARCHAR2(1);
    DAYS daylist := daylist('W', 'A', 'U');
    type countlist IS TABLE OF NUMBER;
    counts countlist := countlist(wkdays(), sadays(), sudays());
    type dayonelist IS TABLE OF NUMBER;
    dayone dayonelist := dayonelist(wkdaysminusone(), sadaysminusone(), sudaysminusone());
    type daytwolist IS TABLE OF NUMBER;
    daytwo daytwolist := daytwolist(wkdaysminustwo(), sadaysminustwo(), sudaysminustwo());
    BEGIN
    vc_firstofmonth := p_first_of_month;
    FOR i IN 1 .. 3 LOOP
    EXECUTE IMMEDIATE 'INSERT INTO RFC' || DAYS(i) || 'BUSAVG_RIDES_AND_PROD(ROUTE, THIRD_YEAR, SECOND_YEAR, PRESENT_YEAR,
    PER_DIFF_THIRDTOPRESENT, PER_DIFF_SECONDTOPRESENT, ROUTETWO, PASS_PLAT_HOUR)
    select r.*,
    t2.*
    from (
    select *
    from (select route,
    sum(y04)/' || counts(i) || ' y04,
    sum(y05)/' || dayone(i) || ' y05,
    sum(y06)/' || daytwo(i) || ' y06,
    decode(sum(y04),0,0,(sum(y06)-sum(y04))/sum(y04)*100) Percent_difference_04to06,
    decode(sum(y05),0,0,(sum(y06)-sum(y05))/sum(y05)*100) Percent_difference_05to06
    from (select route,
         decode(to_char(service_date,"yy"),"04",Rides,0) y04,
    decode(to_char(service_date,"yy"),"05",Rides,0) y05,
         decode(to_char(service_date,"yy"),"06",Rides,0) y06
    from bus_daily_rides
    where TO_CHAR(service_date, "YY") IN ("04","05", "06")
    AND TO_CHAR(SERVICE_DATE,"MM")=TO_CHAR(vc_FirstofMonth, "MM")
    AND day_type=' || DAYS(i) || '
    group by route
    WHERE ROWNUM > 0
    ) r,
    ' || DAYS(i) || '"_"Route_productivity t2
    where t2.route = r.route
    VALUES(p_route,
    p_third_year,
    p_second_year,
    p_present_year,
    p_thirdtopresent,
    p_secondtopresent,
    p_routetwo,
    p_ppph) USING counts(i), days(i), daysone(i), daystwo(i)';
    END LOOP;
    END;
    END accessreports;

  • Is there a way to avoid the function call ?

    Given the following test case
    CREATE USER TESTER
      IDENTIFIED BY "tester"
      DEFAULT TABLESPACE USERS
      TEMPORARY TABLESPACE TEMP
    GRANT CONNECT, RESOURCE TO TESTER
    GRANT CREATE TYPE TO TESTER
    GRANT CREATE SESSION TO TESTER
    GRANT CREATE PROCEDURE TO TESTER
    GRANT CREATE TABLE TO TESTER
    GRANT UNLIMITED TABLESPACE TO TESTER
    ALTER USER TESTER QUOTA UNLIMITED ON USERS
    COMMIT
    CONNECT TESTER/tester
    CREATE OR REPLACE TYPE TESTER.PATTERN_LIST AS TABLE OF VARCHAR2(1023 CHAR)
    SHOW ERRORS
    CREATE TABLE TESTER.PARENT_TABLE
       FIELD_ID     NUMBER(10)          NOT NULL,
       FIELD_NAME   VARCHAR2( 255 CHAR) NOT NULL,
       FIELD_PATH   VARCHAR2(1023 CHAR) NOT NULL,
       FIELD_VALUE  VARCHAR2( 255 CHAR)
    CREATE TABLE TESTER.CHILD_TABLE
      FIELD_PATH    VARCHAR2(1023 CHAR) NOT NULL,
      MIN_STR_LEN   NUMBER(10),
      MAX_STR_LEN   NUMBER(10),
      PATTERNS      TESTER.PATTERN_LIST
    NESTED TABLE PATTERNS STORE AS PATTERN_TABLE RETURN AS VALUE
    ALTER TABLE TESTER.PARENT_TABLE ADD (
      CONSTRAINT PARENT_TABLE_PK
    PRIMARY KEY
    (FIELD_ID))
    INSERT ALL
      INTO TESTER.PARENT_TABLE
    VALUES (1, 'FIELD_A', '/A', NULL)
      INTO TESTER.PARENT_TABLE
    VALUES (2, 'FIELD_AB', '/A/B', '20090731')
      INTO TESTER.PARENT_TABLE
    VALUES (3, 'FIELD_AC', '/A/C', '2167')
      INTO TESTER.PARENT_TABLE
    VALUES (4, 'FIELD_AC', '/A/C', '1144')
      INTO TESTER.PARENT_TABLE
    VALUES (5, 'FIELD_AD', '/A/D', 'XS10')
      INTO TESTER.PARENT_TABLE
    VALUES (6, 'FIELD_AB', '/A/B', '20090229')
      INTO TESTER.PARENT_TABLE
    VALUES (7, 'FIELD_AD', '/A/D', 'ART')
      INTO TESTER.PARENT_TABLE
    VALUES (8, 'FIELD_AD', '/A/D', 'TESTED')
      INTO TESTER.CHILD_TABLE
    VALUES ('/A', NULL, NULL, PATTERN_LIST())
      INTO TESTER.CHILD_TABLE
    VALUES ('/A/B',   NULL, NULL, PATTERN_LIST(   '[12][0-9]{3}[0][13578]([0][1-9]|[12][0-9]|[3][01])'
                                                , '[12][0-9]{3}[0][469]([0][1-9]|[12][0-9]|[3][0])'
                                                , '[12][0-9]{3}[1][02][3][1]'
                                                , '[12][0-9]{3}[1][1][3][0]'
                                                , '[12][0-9]{3}[0][2][2][8]'
                                                , '([2][048]|[1][26])([02468][048]|[13579][26])[0][2][2][9]'))
      INTO TESTER.CHILD_TABLE
    VALUES ('/A/C',   NULL, NULL, PATTERN_LIST(  '[0-1][0-9][0-5][0-9]'
                                               , '[2][0-3][0-5][0-9]'))
      INTO TESTER.CHILD_TABLE
    VALUES ('/A/D',   3, 4, PATTERN_LIST('[^0-9]*'))
    SELECT * FROM DUAL
    CREATE OR REPLACE FUNCTION TESTER.MATCH_PATTERN(p_value IN VARCHAR2, p_patterns IN TESTER.PATTERN_LIST) RETURN NUMBER
    AS
    v_count NUMBER := 0;
    BEGIN
       SELECT COUNT(*)
         INTO v_count
         FROM TABLE(p_patterns)
        WHERE REGEXP_SUBSTR(p_value, COLUMN_VALUE) = p_value;
        RETURN v_count;
    END MATCH_PATTERN;
    SHOW ERRORS
    COMMIT
    /the query
    SELECT   FIELD_ID
           , FIELD_PATH
           , ERRINDEX
           , FIELD_VALUE
      FROM (
               SELECT   a.FIELD_ID
                      , a.FIELD_PATH
                      , b.PATTERNS
                      , CASE
                           WHEN ((b.MIN_STR_LEN IS NOT NULL) AND ((a.FIELD_VALUE IS NULL) OR (LENGTH(a.FIELD_VALUE) < b.MIN_STR_LEN))) THEN 1
                        END AS ERRINDEX_1
                      , CASE
                           WHEN ((b.MAX_STR_LEN IS NOT NULL) AND ((a.FIELD_VALUE IS NULL) OR (LENGTH(a.FIELD_VALUE) > b.MAX_STR_LEN))) THEN 2
                        END AS ERRINDEX_2
                      , CASE
                           WHEN ((b.PATTERNS IS NOT EMPTY) AND ((SELECT COUNT(*) FROM TABLE(b.PATTERNS) WHERE REGEXP_SUBSTR(a.FIELD_VALUE, COLUMN_VALUE) = a.FIELD_VALUE) = 0)) THEN 4
                        END AS ERRINDEX_4
                      , a.FIELD_VALUE
                 FROM            TESTER.PARENT_TABLE a
                      INNER JOIN TESTER.CHILD_TABLE  b ON a.FIELD_PATH = b.FIELD_PATH
              UNPIVOT
                 ERRINDEX
                 FOR COL IN (ERRINDEX_1, ERRINDEX_2, ERRINDEX_4)
           )gives me ORA-03113: end-of-file on communication channel
    If on the other hand, I replace the nested single-row SELECT with the function call like this
    SELECT   FIELD_ID
           , FIELD_PATH
           , ERRINDEX
           , FIELD_VALUE
      FROM (
               SELECT   a.FIELD_ID
                      , a.FIELD_PATH
                      , b.PATTERNS
                      , CASE
                           WHEN ((b.MIN_STR_LEN IS NOT NULL) AND ((a.FIELD_VALUE IS NULL) OR (LENGTH(a.FIELD_VALUE) < b.MIN_STR_LEN))) THEN 1
                        END AS ERRINDEX_1
                      , CASE
                           WHEN ((b.MAX_STR_LEN IS NOT NULL) AND ((a.FIELD_VALUE IS NULL) OR (LENGTH(a.FIELD_VALUE) > b.MAX_STR_LEN))) THEN 2
                        END AS ERRINDEX_2
                      , CASE
                           WHEN ((b.PATTERNS IS NOT EMPTY) AND (TESTER.MATCH_PATTERN(a.FIELD_VALUE, b.PATTERNS) = 0)) THEN 4
                        END AS ERRINDEX_4
                      , a.FIELD_VALUE
                 FROM            TESTER.PARENT_TABLE a
                      INNER JOIN TESTER.CHILD_TABLE  b ON a.FIELD_PATH = b.FIELD_PATH
              UNPIVOT
                 ERRINDEX
                 FOR COL IN (ERRINDEX_1, ERRINDEX_2, ERRINDEX_4)
           )the query gives the correct results which should be
    FIELD_ID    FIELD_PATH    ERRINDEX    FIELD_VALUE
    6           /A/B          4           20090229
    3           /A/C          4           2167
    5           /A/D          4           XS10
    8           /A/D          2           TESTEDIs there a way to do this without the PL/SQL function call and at the same time avoid the ORA-03113 ? Or, have I hit a bug on 11.1.0.7 ?
    Many thanks in advance
    Best Regards
    Philip

    I found the Oracle Bug on my own in the end, in the most unlikely of places !
    The following code
    SELECT   FIELD_ID
           , FIELD_PATH
           , ERRINDEX
           , FIELD_VALUE
      FROM (
               SELECT   a.FIELD_ID
                      , a.FIELD_PATH
                      , CASE
                           WHEN ((b.MIN_STR_LEN IS NOT NULL) AND ((a.FIELD_VALUE IS NULL) OR (LENGTH(a.FIELD_VALUE) < b.MIN_STR_LEN))) THEN 1
                        END AS ERRINDEX_1
                      , CASE
                           WHEN ((b.MAX_STR_LEN IS NOT NULL) AND ((a.FIELD_VALUE IS NULL) OR (LENGTH(a.FIELD_VALUE) > b.MAX_STR_LEN))) THEN 2
                        END AS ERRINDEX_2
                      , CASE
                           WHEN ((b.PATTERNS IS NOT EMPTY) AND ((SELECT COUNT(*) FROM TABLE(b.PATTERNS) WHERE REGEXP_SUBSTR(a.FIELD_VALUE, COLUMN_VALUE) = a.FIELD_VALUE) = 0)) THEN 4
                        END AS ERRINDEX_4
                      , a.FIELD_VALUE
                 FROM            TESTER.PARENT_TABLE a, TESTER.CHILD_TABLE b
                WHERE a.FIELD_PATH = b.FIELD_PATH
              UNPIVOT
                 ERRINDEX
                 FOR COL IN (ERRINDEX_1, ERRINDEX_2, ERRINDEX_4)
           )works as intended i.e. like a charm !
    The only difference between the one that gives the ORA-03113 and the above is the way the join is written. The ANSI way (INNER JOIN) fails, the old way (WHERE clause) succeeds.
    I will open a SR with Oracle so that it may be recorded and fixed.
    Best Regards
    Philip

  • Java function call from Trigger in Oracle

    Moderator edit:
    This post was branched from an eleven-year-old long dead thread
    Java function call from Trigger in Oracle
    @ user 861498,
    For the future, if a forum discussion is more than (let's say) a month old, NEVER resurrect it to append your new issue. Always start a new thread. Feel free to include a link to that old discussion if you think it might be relevant.
    Also, ALWAYS use code tags as is described in the forum FAQ that is linked at the upper corner of e\very page. Your formulae will be so very much more readable.
    {end of edit, what follows is their posting}
    I am attempting to do a similar function, however everything is loaded, written, compiled and resolved correct, however, nothing is happening. No errors or anything. Would I have a permission issue or something?
    My code is the following, (the last four lines of java code is meant to do activate a particular badge which will later be dynamic)
    Trigger:
    CREATE OR REPLACE PROCEDURE java_contact_t4 (member_id_in NUMBER)
    IS LANGUAGE JAVA
    NAME 'ThrowAnError.contactTrigger(java.lang.Integer)';
    Java:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ThrowAnError" AS
    // Required class libraries.
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.ekahau.common.sdk.*;
    import com.ekahau.engine.sdk.*;
    // Define class.
    public class ThrowAnError {
    // Connect and verify new insert would be a duplicate.
    public static void contactTrigger(Integer memberID) throws Exception {
    String badgeId;
    // Create a Java 5 and Oracle 11g connection.
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    // Create a prepared statement that accepts binding a number.
    PreparedStatement ps = conn.prepareStatement("SELECT \"Note\" " +
    "FROM Users " +
    "WHERE \"User\" = ? ");
    // Bind the local variable to the statement placeholder.
    ps.setInt(1, memberID);
    // Execute query and check if there is a second value.
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    badgeId = rs.getString("Note");
    // Clean up resources.
    rs.close();
    ps.close();
    conn.close();
    // davids badge is 105463705637
    EConnection mEngineConnection = new econnection("10.25.10.5",8550);
    mEngineConnection.setUserCredentials("choff", "badge00");
    mEngineConnection.call("/epe/cfg/tagcommandadd?tagid=105463705637&cmd=mmt%203");
    mEngineConnection.call("/epe/msg/tagsendmsg?tagid=105463705637&messagetype=instant&message=Hello%20World%20from%20Axium-Oracle");
    Edited by: rukbat on May 31, 2011 1:12 PM

    To followup on the posting:
    Okay, being a oracle noob, I didn't know I needed to tell anything to get the java error messages out to the console
    Having figured that out on my own, I minified my code to just run the one line of code:
    // Required class libraries.
      import java.sql.*;
      import oracle.jdbc.driver.*;
      import com.ekahau.common.sdk.*;
      import com.ekahau.engine.sdk.*;
      // Define class.
      public class ThrowAnError {
         public static void testEkahau(Integer memberID) throws Exception {
         try {
              EConnection mEngineConnection = new EConnection("10.25.10.5",8550);
         } catch (Throwable e) {
              System.out.println("got an error");
              e.printStackTrace();
    }So, after the following:
    SQL> {as sysdba on another command prompt} exec dbms_java.grant_permission('AXIUM',"SYS:java.util.PropertyPermission','javax.security.auth.usersubjectCredsOnly','write');
    and the following as the user
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(10000);
    I run the procedure and receive the following message.
    SQL> call java_contact_t4(801);
    got an error
    java.lang.NoClassDefFoundError
         at ThrowAnError.testEkahau(ThrowAnError:13)
    Call completed.
    NoClassDefFoundError tells me that it can't find the jar file to run my call to EConnection.
    Now, I've notice when I loaded the sdk jar file, it skipped some classes it contained:
    c:\Users\me\Documents>loadjava -r -f -v -r "axium/-----@axaxiumtrain" ekahau-engine-sdk.jar
    arguments: '-u' 'axium/***@axaxiumtrain' '-r' '-f' '-v' 'ekahau-engine-sdk.jar'
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    creating : class com/ekahau/common/sdk/EConnection
    loading : class com/ekahau/common/sdk/EConnection
    creating : class com/ekahau/common/sdk/EErrorCodes
    loading : class com/ekahau/common/sdk/EErrorCodes
    skipping : resource META-INF/MANIFEST.MF
    resolving: class com/ekahau/common/sdk/EConnection
    skipping : class com/ekahau/common/sdk/EErrorCodes
    skipping : class com/ekahau/common/sdk/EException
    skipping : class com/ekahau/common/sdk/EMsg$EMSGIterator
    skipping : class com/ekahau/common/sdk/EMsg
    skipping : class com/ekahau/common/sdk/EMsgEncoder
    skipping : class com/ekahau/common/sdk/EMsgKeyValueParser
    skipping : class com/ekahau/common/sdk/EMsgProperty
    resolving: class com/ekahau/engine/sdk/impl/LocationImpl
    skipping : class com/ekahau/engine/sdk/status/IStatusListener
    skipping : class com/ekahau/engine/sdk/status/StatusChangeEntry
    Classes Loaded: 114
    Resources Loaded: 1
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    .... with no explanation.
    Can anyone tell me why it would skip resolving a class? Especially after I use the -r flag to have loadjava resolve it upon loading.
    How do i get it to resolve the entire jar file?
    Edited by: themadprogrammer on Aug 5, 2011 7:15 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:21 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:22 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:23 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:26 AM

  • Function calls in WHERE clause

    Hello,
    I have several procedures that all share a similar snippet of code in the WHERE clause. I tried to make this a function but, using a function increases the execution time of the calling procedure by a factor of ten. I am currently on 8i and will be moving to 9i soon. Was just wondering if there will be any performance increase from this type of function call on 9i vs. 8i.
    Thanks
    :)

    sometimes a perforance hit it worth the maintability factor.I disagree, strongly. The developer's Prime Directive is to make the user's experience a good one. Inflicting poorly performing code on the user in the name of maintinability is not on.
    Q: Why does the code have to be maintained so much?
    A: Because the users' keep complaining about how slow it runs....
    [SOAPBOX]
    Of course in the real world things get confused and it can be quite difficult to distinguish programmers' issues - encapsulation, flexibility, maintainability - from users' issues - correctness, completeness, performance.
    But the relative worth of these things is easy to assess. A highly-modular parameter driven architecture that delivers the wrong answer and takes an age to do it ain't worth jack. Even if it is so maintainable that it's easy to fix every bug in it.
    [SOAPBOX]
    "Whatever waits for us behind those doors, we have a better chance of survival if we stick together." Gladiator
    Cheers, APC

Maybe you are looking for

  • Purchase order save issue, Using through BADI  PROCESS_PO_CUST ME21n

    Hi, Pls  Experts ,can we have some solution for this Purchase order save issue,  we are Using  BADI  PROCESS_PO_CUST currently we are throwing a message  using MMPUR_MESSAGE_FORCED if mandatory custom fields are not entered by the User, When we are s

  • Report painter currency

    Hello Experts, I have an issue to change the currency in report created by report painter. Report library:1VK table : CCSS Currently it is in CNY object currency, but I would like to see the report by CO area currency EUR. I used T-code: RPC0 to set

  • How is receipt date on manually entered PReq determined?

    In SNP, I sometimes manually key PReqs into the planning book (SNP94).  I key them in by entering a quantity at the receiving location, and then selecting a source/means of transport from the popup screen. If I select a MOT with a shorter duration (e

  • Query Performance Tunning

    Dear Experts, I am executing a query which is build on a Multiprovider. The execution time is approx. 12 mins, again if I enable a dimension to analyze it takes another 15 mins. The technical details of the query are: 1) The multiprovider fetches dat

  • Labview 8 crashes when saving a vi with a 'Bundle By Name' function

    We have a working vi (Get_AN_Fast.vi), created with Labview 7.1. Trying to open this vi with Labview 8 crashes Labview. Problem seems to be related to a 'Bundle by Name' function, but it is not that simple as using this function by itself wirks fine.