Function Call

Hi,
I want to make a call to a function that returns a cursor. Is this possible? Can you return a cursor from a function? How would you do it?

This is 9i code - if on 8i or earlier you'll need to replace the sys_refcursor reference with your specific ref cursor type declaration.
sql>create or replace package pkg_rc
  2  is
  3    procedure p_rc;
  4 
  5    function f_rc
  6      return sys_refcursor;
  7  end;
  8  /
Package created.
sql>create or replace package body pkg_rc
  2  is
  3 
  4    procedure p_rc
  5    is
  6      v_rc    sys_refcursor;
  7      v_id    all_objects.object_id%type;
  8      v_name  all_objects.object_name%type;
  9    begin
10      v_rc := f_rc();
11      loop
12        fetch v_rc into v_id, v_name;
13        exit when v_rc%notfound;
14        dbms_output.put_line( v_id || ', ' || v_name );     
15      end loop; 
16      close v_rc;
17    end;
18 
19    function f_rc
20      return sys_refcursor
21    is
22      v_rc  sys_refcursor;
23    begin
24      open v_rc for
25        select object_id, object_name
26          from all_objects
27         where rownum <= 5;
28   
29      return (v_rc);
30    end;
31   
32  end;
33  /
Package body created.
sql>exec pkg_rc.p_rc
17230, /1005bd30_LnkdConstant
7144, /10076b23_OraCustomDatumClosur
22726, /10297c91_SAXAttrList
13554, /103a2e73_DefaultEditorKitEndP
22291, /1048734f_DefaultFolder
PL/SQL procedure successfully completed.

Similar Messages

  • [svn] 3045: Fix FB-13900: Expression Evaluator: 'is' and 'as' expressions return 'Target player does not support function calls'

    Revision: 3045
    Author: [email protected]
    Date: 2008-08-29 10:59:25 -0700 (Fri, 29 Aug 2008)
    Log Message:
    Fix FB-13900: Expression Evaluator: 'is' and 'as' expressions return 'Target player does not support function calls'
    Ticket Links:
    http://bugs.adobe.com/jira/browse/FB-13900
    Modified Paths:
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/BinaryOp.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/PlayerSession.java

    Revision: 3045
    Author: [email protected]
    Date: 2008-08-29 10:59:25 -0700 (Fri, 29 Aug 2008)
    Log Message:
    Fix FB-13900: Expression Evaluator: 'is' and 'as' expressions return 'Target player does not support function calls'
    Ticket Links:
    http://bugs.adobe.com/jira/browse/FB-13900
    Modified Paths:
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/BinaryOp.java
    flex/sdk/trunk/modules/debugger/src/java/flash/tools/debugger/concrete/PlayerSession.java

  • How to call a C function calling a Java Method from another C function ?

    Hi everyone,
    I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
    In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
    Is all that possible ?
    Thank you very much for your help !

    Hard to understand the question, but by most interpretations the answer is going to be yes.
    You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly.

  • Is it possible to get the caller object in a function call hierarchy ?

    Hi,
    I have a problem in hand for adding a new functionality to an existing code with MINIMAL code change. For this I need to get some extra information in a function call from its caller. And for this I do not want to change the signature of the method, as it requires a lot of code change. So I need to have a programming facility by which I can get the object from which the function was invoked. Some thing like "{code}this.CALLEROBJECT{code}".
    Please let me know whether we can achieve this in JAVA. I wonder if such a facility exists in any programming language...
    Thanks in advance.
    Regards
    Joby

    No.
    Youd have to buy it Germany or see if an Apple Authrorized reseller in Singapore could order you the keyboard.

  • 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

  • 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

  • Is it possible to pass table name as parameter to function calls?

    Let's say I would like to retrieve data from table BSAD, BSID, BSIS, BSAS with the exact same WHERE conditions.
    I.E.
          SELECT SINGLE * FROM bsis
               WHERE bukrs = zbukrs
                 AND belnr = zbelnr
                 AND gjahr = zgjahr
                 AND buzei = bseg-buzei.
          SELECT SINGLE * FROM bsas
               WHERE bukrs = zbukrs
                 AND belnr = zbelnr
                 AND gjahr = zgjahr
                 AND buzei = bseg-buzei.
    Is there a way that I could put them into a function and do something like?
    perform select_table_bsas using 'bsas'.
    perform select_table_bsis using 'bsis'.
    and I should get SELECT * FROM passed from the function calls.
    Thanks.

    Hello,
    You can try something like this
    DATA : LV_DBTAB1 LIKE DD02L-TABNAME.
    DATA : DREF TYPE REF TO DATA.
    FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE. " used to store dynamic tables
    LV_DBTAB1 = 'MARA'. " in caps
      CREATE DATA DREF TYPE STANDARD TABLE OF (LV_DBTAB1)
                                WITH NON-UNIQUE DEFAULT KEY.
      ASSIGN DREF->* TO <ITAB> .
    * chooses only english values
      SELECT * FROM (LV_DBTAB1) INTO TABLE <ITAB> WHERE SPRAS = 'E'.
    here, even the internal table is dynamic, but that can be static if you know the structure for sure

  • HT203175 I have no problem signing on to iTunes my issue is once on the site I can not use the "search". It says there is a runtime error R6025 pure virtual function call. Has anyone had this problem and how do I fix it. Thanks

    I do not have a problem getting in the iTunes stores. My issue is once on the site I can not use the "search". It says there is a pure virtual function call R6025. How can I solve this problem? Do I have to create a new account? Do I have to uninstall and re-install? Thanks

    Thanks so much for your feedback. I really appreciate any input here.
    If someone from Adobe could GUARANTEE that this problem would go away if I
    purchased CS4, I would pony up the cash and do it. However, I'm skeptical
    about that because I just saw someone else post a message on the forum today
    who is running CS4 and getting the exact same runtime error as me.
    I'll try un-installing and re-installing as Admin, and if that doesn't work,
    maybe I can find a used copy of CS3.
    In the meantime, I'm also wondering if a Photoshop file can carry any sort
    of corrupt metadata inside it once it has errored out? Reason I ask is, I
    had to port all of my old PSD files to the new computer, and I only seem to
    be getting this error when I attempt to work on one of the files that
    previously got the runtime error when they were sitting on my XP machine.
    When I create new files from scratch on this new computer, they seem to be
    working just fine (at least, for now).
    If so, I would probably be smart to never open those troublesome
    "errored-out" files again.

  • Error while activating expression Functional call

    Hi All,
    I created a functional call expression..I mainteined target function name and result object as well..The syntax check doesn't return any error messages.But when I try to activate it , I get an error message
    ZCALL_FUNCTION_1 (Expression) : No active version found for time stamp 20.111.018.120.507 (Details) Display Longtext.
    I activated all the subobjects..But I still I get the above mentioned error.. Could anyone please suggest me the solution..
    Regards,
    Raghu.

    Hi ,
    Please implement note  1639477.
    Thanks and Regards,
    Rama.

  • Java.lang.VerifyError - Incompatible object argument for function call

    Hi all,
    I'm developing a JSP application (powered by Tomcat 4.0.1 in JDK 1.3, in Eclipse 3.3). Among other stuff I have 3 classes interacting with an Oracle database, covering 3 use cases - renaming, adding and deleting an database object. The renaming class simply updates the database with a String variable it receives from the request object, whereas the other two classes perform some calculations with the request data and update the database accordingly.
    When the adding or deleting classes are executed, by performing the appropriate actions through the web application, Tomcat throws the following:
    java.lang.VerifyError: (class: action/GliederungNewAction, method: insertNewNode signature: (Loracle/jdbc/driver/OracleConnection;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V) Incompatible object argument for function call
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:120)
         at action.ActionMapping.perform(ActionMapping.java:53)
         at ControllerServlet.doResponse(ControllerServlet.java:92)
         at ControllerServlet.doPost(ControllerServlet.java:50)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    ...The renaming works fine though. I have checked mailing lists and forums as well as contacted the company's java support but everything I have tried out so far, from exchanging the xerces.jar files found in JDOM and Tomcat to rebuidling the project didn't help.
    I just can't explain to myself why this error occurs and I don't see how some additional Java code in the other 2 classes could cause it?
    I realize that the Tomcat and JDK versions I'm using are totally out of date, but that's company's current standard and I can't really change that.
    Here's the source code. I moved parts of the business logic from Java to Oracle recently but I left the SQL statements that the Oracle stored procedures are executing if it helps someone.
    package action;
    import java.sql.CallableStatement;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.StringTokenizer;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import oracle.jdbc.driver.OracleConnection;
    * This class enables the creation and insertion of a new catalogue node. A new node
    * is always inserted as the last child of the selected parent node.
    public class GliederungNewAction implements Action {
         public String perform(ActionMapping mapping, HttpServletRequest request,
                   HttpServletResponse response) {
              // fetch the necessary parameters from the JSP site
              // the parent attribute is the selected attribute!
              String parent_attribute = request.getParameter("attr");
              String catalogue = request.getParameter("catalogue");
              int parent_sequenceNr = Integer.parseInt(request.getParameter("sort_sequence"));
              // connect to database    
              HttpSession session = request.getSession();   
              db.SessionConnection sessConn = (db.SessionConnection) session.getAttribute("connection");
              if (sessConn != null) {
                   try {
                        sessConn.setAutoCommit(false);
                        OracleConnection connection = (OracleConnection)sessConn.getConnection();
                        int lastPosition = getLastNodePosition( getLastChildAttribute(connection, catalogue, parent_attribute) );
                        String newNodeAttribute = createNewNodeAttribute(parent_attribute, lastPosition);
                        // calculate the sequence number
                        int precedingSequenceNumber = getPrecedingSequenceNumber(connection, catalogue, parent_attribute);
                        if ( precedingSequenceNumber == -1 ) {
                             precedingSequenceNumber = parent_sequenceNr;
                        int sortSequence = precedingSequenceNumber + 1;
                        setSequenceNumbers(connection, catalogue, sortSequence);
                        // insert the new node into DB
                        insertNewNode(connection, catalogue, newNodeAttribute, parent_attribute, "Neuer Punkt", sortSequence);
                        connection.commit();
                   } catch(SQLException ex) {
                        ex.printStackTrace();
              return mapping.getForward();
          * Creates, fills and executes a prepared statement to insert a new entry into the specified table, representing
          * a new node in the catalogue.
         private void insertNewNode(OracleConnection connection, String catalogue, String attribute, String parent_attribute, String description, int sortSequence) {
              try {
                   String callAddNode = "{ call fasi_lob.pack_gliederung.addNode(:1, :2, :3, :4, :5) }";
                   CallableStatement cst;
                   cst = connection.prepareCall(callAddNode);
                   cst.setString(1, catalogue);
                   cst.setString(2, attribute);
                   cst.setString(3, parent_attribute);
                   cst.setString(4, description);
                   cst.setInt(5, sortSequence);
                   cst.execute();
                   cst.close();
              } catch (SQLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    //          String insertNewNode = "INSERT INTO vstd_media_cat_attributes " +
    //                    "(catalogue, attribute, parent_attr, description, sort_sequence) VALUES(:1, :2, :3, :4, :5)";
    //          PreparedStatement insertStmt;
    //          try {
    //               insertStmt = connection.prepareStatement(insertNewNode);
    //               insertStmt.setString(1, catalogue);
    //               insertStmt.setString(2, attribute);
    //               insertStmt.setString(3, parent_attribute);
    //               insertStmt.setString(4, description);
    //               insertStmt.setInt(5, sortSequence);
    //               insertStmt.execute();
    //               insertStmt.close();
    //          } catch (SQLException e) {
    //               e.printStackTrace();
          * This method returns the attribute value of the last child of the parent under which
          * we want to insert a new node. The result set is sorted in descending order and only the
          * first result (that is, the last child under this parent) is fetched.
          * If the parent node has no children, "parent_attr.0" is returned. 
          * @param connection
          * @param catalogue
          * @param parent_attribute
          * @return attribute of the last child under this parent, or "parent_attr.0" if parent has no children
         private String getLastChildAttribute(OracleConnection connection, String catalogue, String parent_attribute) {
              String queryLastChild = "SELECT attribute FROM vstd_media_cat_attributes " +
                                            "WHERE catalogue=:1 AND parent_attr=:2 ORDER BY sort_sequence DESC";
              String lastChildAttribute;
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(queryLastChild);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attribute);
                   ResultSet rs = ps.executeQuery();
                   /* If a result is returned, the selected parent already has children.
                    * If not set the lastChildAttribute to parent_attr.0
                   if (rs.next()) {
                        lastChildAttribute = rs.getString("attribute");
                   } else {
                        lastChildAttribute = parent_attribute.concat(".0");
                   rs.close();
                   return lastChildAttribute;
              } catch (SQLException e) {
                   e.printStackTrace();
                   return null;
          * This helper method determines the position of the last node in the attribute.
          * i.e for 3.5.2 it returns 2, for 2.1 it returns 1 etc.
          * @param attribute
          * @return position of last node in this attribute
         private int getLastNodePosition(String attribute) {
              StringTokenizer tokenizer = new StringTokenizer(attribute, ".");
              String lastNodePosition = "0";
              while( tokenizer.hasMoreTokens() ) {
                   lastNodePosition = tokenizer.nextToken();
              return Integer.parseInt(lastNodePosition);
          * This method calculates the attribute of a node being inserted
          * by incrementing the last child position by 1 and attaching the
          * incremented position to the parent.
          * @param parent_attr
          * @param lastPosition
          * @return attribute of the new node
         private String createNewNodeAttribute(String parent_attr, int lastPosition) {
              String newPosition = new Integer(lastPosition + 1).toString();
              return parent_attr.concat("." + newPosition);
          * This method checks if the required sequence number for a new node is already in use and
          * handles the sequence numbers accordingly.
          * If the sequence number for a new node is NOT IN USE, the method doesn't do anything.
          * If the sequence number for a new node is IN USE, the method searches for the next free
          * sequence number by incrementing the number by one and repeating the query until no result
          * is found. Then all the sequence numbers between the required number (including, >= relation)
          * and the nearest found free number (not including, < relation) are incremented by 1, as to
          * make space for the new node.
          * @param connection
          * @param catalogue
          * @param newNodeSequenceNumber required sequence number for the new node
         private void setSequenceNumbers(OracleConnection connection, String catalogue, int newNodeSequenceNumber) {
              // 1. check if the new sequence number exists - if no do nothing
              // if yes - increment by one and see if exists
              //           repeat until free sequence number exists
              // when found increment all sequence numbers freeSeqNr > seqNr >= newSeqNr
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                        "WHERE catalogue=:1 AND sort_sequence=:2";
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setInt(2, newNodeSequenceNumber);               
                   ResultSet rs = ps.executeQuery();
                   // if no result, the required sequence number is free - nothing to do
                   if( rs.next() ) {
                        int freeSequenceNumber = newNodeSequenceNumber;
                        do {
                             ps.setString(1, catalogue);
                             ps.setInt(2, freeSequenceNumber++);
                             rs = ps.executeQuery();
                        } while( rs.next() );
                        // increment sequence numbers - call stored procedure
                        String callUpdateSeqeunceNrs = "{ call fasi_lob.pack_gliederung.updateSeqNumbers(:1, :2, :3) }";
                        CallableStatement cst = connection.prepareCall(callUpdateSeqeunceNrs);
                        cst.setString(1, catalogue);
                        cst.setInt(2, newNodeSequenceNumber);
                        cst.setInt(3, freeSequenceNumber);
                        cst.execute();
                        cst.close();
    //                    String query2 = "UPDATE vstd_media_cat_attributes " +
    //                                      "SET sort_sequence = (sort_sequence + 1 ) " +
    //                                      "WHERE catalogue=:1 sort_sequnce >=:2 AND sort_sequence <:3";
    //                    PreparedStatement ps2;
    //                    ps2 = connection.prepareStatement(query2);
    //                    ps2.setString(1, catalogue);
    //                    ps2.setInt(2, newNodeSequenceNumber);
    //                    ps2.setInt(3, freeSequenceNumber);
    //                    ps.executeUpdate();
    //                    ps.close();
                   } // end of if block
                   rs.close();
              } catch (SQLException e) {
                   e.printStackTrace();
          * This method finds the last sequence number preceding the sequence number of a node
          * that is going to be inserted. The preceding sequence number is required to calculate
          * the sequence number of the new node.
          * We perform a hierarchical query starting from the parent node: if a result is returned,
          * we assign the parent's farthest descendant's node sequence number; if no result
          * is returned, we assign the parent's sequence number.
          * @param connection
          * @param catalogue
          * @param parent_attr parent attribute of the new node
          * @return
         private int getPrecedingSequenceNumber(OracleConnection connection, String catalogue, String parent_attr) {
              int sequenceNumber = 0;
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                                "WHERE catalogue=:1 " +
                                "CONNECT BY PRIOR attribute = parent_attr START WITH parent_attr=:2 " +
                                "ORDER BY sort_sequence DESC";
              try {
                   PreparedStatement ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attr);
                   ResultSet rs = ps.executeQuery();
                   if ( rs.next() ) {
                        sequenceNumber = rs.getInt("sort_sequence");
                   } else {
                        // TODO: ggf fetch from request!
                        sequenceNumber = -1;
                   rs.close();
                   ps.close();
              } catch (SQLException e) {
                   e.printStackTrace();
              return sequenceNumber;
    }

    After further googling I figured out what was causing the problem: in eclipse I was referring to external libraries located in eclipse/plugins directory, whereas Tomcat was referring to the same libraries (possibly older versions) in it's common/lib directory.

  • When i open my i3tunes on my computer i get an error message telling me that iTunes has stopped working..the message is as follows...Microsoft Visual C  runtime library Program C:\program files (86) iTunes\iTunes.exe  R6025 -Pure virtual function call..

    when i open my i3tunes on my computer i get an error message telling me that iTunes has stopped working..the message is as follows...Microsoft Visual C  runtime library Program C:\program files (86) iTunes\iTunes.exe  R6025 -Pure virtual function call.. How do i fix this

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • ITunes crashes when doing a power search. I get a Microsoft Visual C   Runtime Library Error message: Program C:\Program Files (x86)\iTunes\iTunes.exe R6025.  Pure virtual functional call.  If I select ok, Windows 7 pops up with iTunes has stopped working

    iTunes crashes when doing a power search. I get a Microsoft Visual C   Runtime Library Error message: Program C:\Program Files (x86)\iTunes\iTunes.exe R6025.  Pure virtual functional call.  If I select ok, Windows 7 pops up with iTunes has stopped working and then it shuts iTunes down.  Anyone else every have this issue.  Any ideas on a fix?
    Thanks,

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • 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

  • "R6025 -pure virtual function call" Error While Use Adobe Media Encoder

    I'm trying to use Adobe Media Encoder (CS3) to output a project to H.264. I have about 3 minutes of footage on the Premier Pro CS3 Timeline, all of it in Cineform AVI intermediate format. When I export the movie through AME and select 2-pass VBR, it gets through the first pass, but crashes at 50% on the second pass with the error:
    "Microsoft Visual C++ Runtime Library
    Runtime Error!
    Program E:\Progra...
    R6025
    -pure virtual function call"
    Any ideas what may be causing this error?

    Point taken...
    I'm on a Dell XPS 720 Windows XP (32-bit) system, with all up-to-date service packs and patches. I have 4GB RAM installed, and Production Premium CS3, TMPGEncXPress and Cineform's Neo Scene. Neo Scene is a recent addition and the problem existed prior to its installation. I have two 7900GS graphics cards (each with 256MB video RAM), running in SLI mode.
    I dual boot Windows XP: One system is "Messy" with all kinds of stuff installed. The other is "Clean" and has virtually nothing installed, except for the three suites previously mentioned. No anti-virus or anti-spyware software is installed on the Clean system. I get the error on both systems.
    I saw the post from September 2007 reference vcredist_x86. I'll be trying that at my next opportunity, however, I'm not sure that will fix it, as I don't see why both systems would suffer from the same corruption. I'll also be swapping out RAM to see if that fixes the issue.

  • I can't search a song or an artist.  i get an error R6025/pure virtual function call. then itunes stops working.  PLEASE HELP

    I can't search a song or an artist without getting an error R6025 - pure virtual function call. Then itunes stops working. How do I fix it?  PLEASE HELP

    I have had numerous issues with Itunes 64 bit 11.1.38 (and other previous versions) locking up and crashing upon start with "Itunes has stopped working" or "R6027 pure virtual function call".  I have researched the answers around the forums as well as having tried some extensive and repetitious troubleshooting myself and thought I'd list them here... in order of troubleshooting...
    1. Install all Windows updates and reboot.  This seems to clear issues from time-to-time... I suspect Itunes expects the latest-and-greatest as far as Windows is concerned.. see if this clears your issue.
    2. Uninstall all Itunes and Apple products & reboot, remove their directories, remove lingering Itunes registry entries, reboot again, reinstall using "RUN AS ADMINISTRATOR" to install the Itunes executable. See if this allows Itunes to stabilize.  Pelase be sure to use the following guide from Apple as far as removing the apps and directories are concerned...
    http://support.apple.com/kb/ht1923
    3. Remove the contents of the "iphone photo cache"  (or other related product photo cache)  directory.
    4. Try editing the shortcut properties and configure the shortcut (for all users) to run as Administrator.
    5. Try editing the shortcut and configure it to run in Compatibility Mode for Windows 7 (for all users).
    6. a.Try using MSCONFIG to locate a potential conflicting application or service using the following...
    http://support.apple.com/kb/ht2292
    or
    6. b. Remove the last recent software application(s) you may have installed... in my case removing GREENSHOT http://getgreenshot.org/  stopped my Itunes from crashing on startup and it stabilized after
    driving my nuts for weeks.
    Message was edited by: DaCheeze

Maybe you are looking for

  • What is the latest free download for iPhoto?

    Hi, I use a Power Mac G4; run MacOS OX 10.4.11 Tiger; use iPhoto 1.1.1.  What is the latest free download for iPhoto under Tiger, and where do I download it? Sincerely, Angel

  • Edit Derived Priority Matrix

    SD 702 Is there any way to tweak the priority table/matrix used by SD when assignig priority using the derived method? Thanks Osh..

  • New PC rig won't start up

    Ok, I've built a few PCs from scratch in my day, but I just can't seem to figure this one out. My assumption is that I have a compatability problem somewhere, but I was hoping that someone might be able to chip in a help me out before I start shellin

  • How to compare two date Objects

    Hi, I have two Calendar Objects, one is coming from client and one is my server time, I need to evaluate that incoming time with server time so that if it is sent before an hour back then i should not do anything on that request Object. I have conver

  • Delivery date should fall on every monday for a PR created by MRP

    Hi Gurus, A PR is created by MRP. I need to have delivery date of the PR on every monday. Please let me know , what settings has to be done... Regards, Vibin