Session value during function call

I am not able to catch new updated value from session even after i have used
response.sendRedirect("");
to resubmit page.
Is there any another way so that i can get the updated session value during any function call generated by another frame on the same page.

Is there any who have some thing to say about it ..

Similar Messages

  • After a function call values in the system sy-msgty.........

    After a function call values in the system sy-msgty,sy-msgit and sy-msgno are getting empty. And the program dumped suddenly with showing a message_type_unknown message.
    Here i wanted to know y these values are becoming empty
    Pls help me out here

    The first Idoc has two line items and the second idoc has 7 line items. As the split is per 5 line item- the target has 3 Idocs.
    Now the problem is that the header value in the target: REF_DOC_NO has to be created as per the number of line items and doesnt come from header record directly.

  • Saving session state during pagination

    See
    http://htmldb.oracle.com/pls/otn/f?p=24317:152
    I hacked into the PPR function to save the checkbox value into session state during pagination.
    Is there a way to do something similar for checkboxes in the report itself rendered using htmldb_item.checkbox()?
    Or is this an ill-advised effort?
    [The UI requirement here is clear...I have a bunch of items over many pages and I want to select them using checkboxes and have the selections remembered as I paginate back and forth.
    If you use Yahoo Mail, Compose a new message, click on the Insert Addresses link and it pops up a window with all your contacts, you can select them using checkboxes and go to the Next/Previous page and it remembers the selections]
    Thanks

    See
    http://htmldb.oracle.com/pls/otn/f?p=24317:152
    Click on the Create/Reset collection button to initialize your own private collection to play with.
    The checkboxes are remembered as you paginate thru the resultset. Basically, the state of the checkboxes is saved into session state using htmldb_Get before calling the PPR function to get the next/previous rows.
    Carl, let me know what you think of the approach. Is it a viable approach? Any caveats?
    [Unfortunately, I had to to make a copy of the builtin html_PPR_Report_Page function to make the above modification in it, didnt see a way to avoid it]
    Thanks

  • Passing Session Values to the Tabular Form Element of a Report Column

    Hello,
    I'm running application express version 2.0 with a 10.2.0.2.0 database on a 32 bit windows box. I'm trying to figure out sneaky a way to pass the &APP_PAGE_ID., #APP_PAGE_ID# or V('APP_PAGE_ID'); as an element attribute of a Report Tabular Form Element set to display as a Select List (named LOV).
    It seems that whatever option I choose, the Element Attributes field will only render the literal value of what I have entered. This is part of the solution but I would like to find a way to pass the current page id.
    What I'm trying to do is utilize the ONCHANGE attribute to redirect to a report page in my application when the value from a Select List (named LOV) is selected.
    I could work around this by creating my own table output with PL/SQL and HTP.P commands but would really be interested in finding out if I can use the reporting structures which are already available through Application Express.
    Any ideas?
    Thanks.
    Justin.

    Thanks for the response Earl. To clarify this is what I've done and what I hope to achieve:
    I currently have a LOV for my application that identifies a number of database report types: DB Options, DB Parameters, DB Version, and so on.
    I have an application express report being generated for the databases I'm monitoring and it displays as follows:
    - HOST -- DBTYPE -------- DBNAME - DBREPORTS
    =====================================
    - SVR 1 - Oracle 9.2.0.1 - DEV -------- [LOV HERE]
    - SVR 2 - Oracle 9.2.0.7 - TST --------- [LOV HERE]
    I am displaying the LOV on my report the the options under the reports attribute tab in my application builder. I insert my LOV select list by editing the DBREPORTS column and set the "Display As:" option under Tabular Form Element to "Select List (named LOV)"; I have also added my LOV to the "Named LOV" option under List of Values.
    So far this achieves everything I would expect and works quite well (a select list with my report types appears in my monitor report for each DB that is returned).
    What I'm interested in doing now is opening a DBREPORT for a given database by simply choosing the report type from my LOV. I can set the "Element Attributes" option under Tabular Form Element to execute a javascript call for any valid event (in my case I'm using ONCHANGE).
    My only issue is that I cannot find a way to pass any session values from my page to my Element Attribute. If, in the Element Attributes field I enter:
    onchange="alert(this.value);" //my dialogue box will display the value of my current selection when I choose a report type.
    What I'd love to be able to do is something like:
    onchange="alert('&APP_PAGE_ID.');" //so my current page id is written to the element.
    Unfortunately, only my literal text seems to be rendered. Rather than having my dialogue come back with my page number, say 75, I receive the literal value &APP_PAGE_ID.
    Notwithstanding any quote issues, I've tried to dump a test html attribute to my source html by entering any of the following in the Element Attributes field:
    test=&APP_PAGE_ID.
    test=#APP_PAGE_ID#
    and as a shot in the dark knowing that I'm not using PL/SQL:
    test=V('APP_PAGE_ID');
    In every case when I view source I see the literal value of what was entered in the Element Attributes field (ie "test=&APP_PAGE_ID." instead of "test=75").
    What makes things a little more frustrating is that I can drop &APP_PAGE_ID. into the Column Heading field (ex My Heading &APP_PAGE_ID.), it renders as I would expect; "My Heading 75". If we could find a solution to this, I could see a number of slick uses for this type of functionality.
    Hope this helps,
    Thanks.
    Justin.

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

  • RMI server and client in one application - Exceptions during some calls

    I wrote an application, which is an RMI-Server (Server1), and another separate application, which is an RMI-Client (Client1). Because I wont use dynamic class loading, I gave the client beside the interface.java also an interface_implementation.java, which is only a dummy of the original interface_implementation of the server. This dummy contains only declarations of the methods (parameters and return values) and no functional code. From this dummy the _stub.class is generated, and it works fine - no problem.
    Now I want to modify Client1 to become also an RMI-Server (Server2) for a second, separate Client (Client2), the methods used are different from the first RMI connection. This Client2 uses a dummy of the implementation of Server2 in the same way as described above. The application Client1+Server2 only has to "translate" the calls from Client2 to Server2 into calls of Client1 to Server1 (Server1 is not changed at all). In case of primitive method parameters or return values this chain of RMI-applications works fine, but in case of more complex structures (my own classes) during the call of Client1 to Server1 an "ClassNotFoundException: access denied to class loader" occurs by running through the stub. Both stub.classes are found, all of the applications know the objects needed, the call of Client1 to Server1 is exactly the same call as it was during the simple version (only Server1 and Client1).
    Does anybody know, why this exception occurs and how I can overcome this ?
    Axel

    I figured out a solution - it's a problem of policies. In detail: Server1's codebase entry (file:) refers to the class directory of Server1's project. In the simple case of only Client1, which has no codebase entry, it works fine without a file permission on the side of Server1. In the complex case of Client1+Server2, which has to have a codebase entry (file:) refering to the class directory of the Server2's project on a separate machine, for exactly the same method call from Client1 to Server1 a file permission entry on the side of Server1 is needed for Server1's class directory. But WHY ???
    It seems to be a little confusing with the codebase entries, many of the posts are contrary to others and to my personal experiences. Some comments given by Adrian Colley throw a little light upon some aspects. Is there anybody, who can explain the whole topic, when, why, and which part of RMI application deals with codebase entries, also in case of not dynamic code downloading ? May be there is also a reference into the java docs, which I didn't found up to now.
    Thanks in advance
    Axel

  • Function Call returning old SQL Query

    Hello All,
    I have a Pipeline Function which creates a SQL within (Dynamic SQL that gets stored in a LONG variable) based on the parameter STRING passed to the function. Inside this function, once the SQL is built, I am inserting this SQL into a log table, for logging purpose.
    Note: my function has only one parameter which is a string. This string accepts a name:value pairs with a delimiter which I breakdown inside the function. But this functionality is working fine.
    Issue:
    When I run the function with parameter with a STRING say (Age = 20, Gender = M) for the first time, it works.
    <code>SELECT * FROM TABLE (
    PIPE_FUN_SEARCH_PKG.get_search_records ('EMP_AGE:20|EMP_GENDER:M'));
    </code>
    When I change the parameters to (Age = 20, Gender = F), it gives me the results of the earlier function call.
    <code>SELECT * FROM TABLE (
    PIPE_FUN_SEARCH_PKG.get_search_records ('EMP_AGE:20|EMP_GENDER:F'));
    </code>
    When I open the logs, I see the SQL being built is the earlier one.
    As a test I closed the session and ran (Age = 20, Gender = F) first. It works fine. When I run a different parameter string, it always mimics the earlier function call.
    Is CACHING in play here. I tried both the following:
    <code> dbms_result_cache.bypass(FALSE);
    dbms_result_cache.flush;
    </code>
    I tried multiple tests, with different parameters and only the first one runs fine and second one copied the earlier. However, when I open two sessions on two different windows it doesn't happen.
    Also, in the Logging table I am capturing the input string as a confirmation, which is coming correctly. But the SQL being build mimics the earlier call.
    I tried to set the variable which hold the SQL Statement to empty (v_sql := '';) at the beginning and also at the end. Still no use.
    Kindly help if I am over looking anything.
    Regards,
    Aj

    Aj09 wrote:
    I have a Pipeline Function which creates a SQL within (Dynamic SQL that gets stored in a LONG variable) based on the parameter STRING passed to the function. The LONG data type has been replaced by the LOB data type. Oracle specifically recommends not using the old LONG data type.
    Issue:
    When I run the function with parameter with a STRING say (Age = 20, Gender = M) for the first time, it works.
    <code>SELECT * FROM TABLE (
    PIPE_FUN_SEARCH_PKG.get_search_records ('EMP_AGE:20|EMP_GENDER:M'));
    </code>
    When I change the parameters to (Age = 20, Gender = F), it gives me the results of the earlier function call.
    <code>SELECT * FROM TABLE (
    PIPE_FUN_SEARCH_PKG.get_search_records ('EMP_AGE:20|EMP_GENDER:F'));
    </code>The tag is ** - not *<code>*.
    Why a pipeline function? Why dynamic SQL? Are you using +DBMS_SQL+ to create the dynamic cursor? If not, why not? Only +DBMS_SQL+ allows dynamic binding in PL/SQL. Without that, your code will burn a lot of additional CPU on hard parsing and trash and fragment Shared Pool memory.
    When I open the logs, I see the SQL being built is the earlier one.
    How do you record the current SQL? Are you using a static variable to capture the SQL statement generated?
    From what you have described - this is yet another horribly flawed approach in all respects. To data modelling. To relational databases. To Oracle. To SQL.
    Reinventing the SQL language for data retrieval as a pipeline function using a funky parameter interface - sorry, I just don't get that. It is an insane approach.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • [Insert in to table with the values of function]

    Hi,
    I was written the following procedure in my DB to get the values of bonuses and id from the table employee_290512
    create or replace procedure ins_desc is
    cursor i1 is
    select id, decode (description,'Tester',salary*15,'Programmer',salary*30,'Manager',salary*30) bonus from employee_290512;
    v_id employee_290512.id%type;
    v_bonus employee_290512.salary%type;
    Begin
    open i1;
    loop
    fetch i1 into v_id,v_bonus;
    exit when i1% notfound;
    dbms_output.put_line (v_id || ' '||v_bonus);
    end loop;
    close i1;
    end;
    I written the following function by calling the above procedure inside the function to achieve the result like this
    create or replace function bon_chk return number
    is
    v_result number;
    begin
    ins_desc;
    return v_result;
    end;
    I written the above two stuffs to insert the output values of function in to the table called bonuses_proc having the values (id,bonus)
    To achieve the above I executed the following query
    insert into bonuses_proc (employee_id,bonus) select bon_chk from dual;
    During the above it throws the error ORA-00947: not enough values
    i understand the function return the v_result as onve value so it throws the above error
    Could any one please clarify me on this?
    Regards
    Thelak
    Edited by: thelakbe on Jun 5, 2012 12:00 PM
    Edited by: thelakbe on Jun 5, 2012 12:01 PM
    Edited by: thelakbe on Jun 5, 2012 12:01 PM

    Hi,
    yes we can do like above too, but i dont want to give the insert permission to the table to all the user,so is there any possiblities do it with ouput of function?If you would use the output of the function (if it had two values) you also need to do the insert as you tried to do in the initial post:
    insert into bonuses_proc (employee_id,bonus) select bon_chk from dual;If you do not want insert permisions on a table for a user then you can put the whole SQL in a procedure in a schema with insert permisions and give the user exec rigth to that procedure.
    The procedure can be like:
    create or replace
    procedure insert_bonus authid definer as
    begin
    insert into bonuses_proc (employee_id,bonus)
    SELECT
      id
      ,DECODE (description, 'Tester', salary*15, 'Programmer', salary*30, 'Manager', salary*30) bonus
    FROM
      employee_290512;
    end;regards,
    Peter

  • CATCHABLE EXCEPTIONS in the remote function call (RFC)

    Please tell me what are the CATCHABLE EXCEPTIONS in the remote function call (RFC) and to which exception class do they belong????
    Thanks in advance.
    Dinesh Dhiman

    HI,
    With external function calls, the EXCEPTIONS addition of the CALL FUNCTION command can be used to assign return values to the exceptions defined in the interface of the called function module. Class-based exceptions cannot be propagated to the caller from a remotely-called function module, and have the effect of an exception that cannot be handled.
    As well as the exceptions defined in the interface of the called function module, an external function call can also have the following predefined exceptions:
    The <b>SYSTEM_FAILURE</b> exception is the response to a runtime error that occurs when the remotely-called function module is executed.
    The <b>COMMUNICATION_FA</b>ILURE exception occurs when the connection to the partner system cannot be established or if the connection is lost during communication.
    Note
    We strongly recommend that you assign a return value to both these exceptions for every RFC, and that you handle this return value, as otherwise a runtime error will occur in the exception situations in question.
    Regards,
    Sesh

  • Session between multiple Webservice calls from PI7.0

    Hello XI SDNers,
    I am unable to overcome my Webservice session problem using SOAP (Axis) adapter. My scenario is as follows:
    I am calling a external Webservice deployed in Axis webservice engine from PI7.0, during my first call:  I call synchronous "Login" webservice and I became the response "User is Logged in"
    during my second synchronous call "GetItem", the webservice returns "The user doesn't have valid session". The two synchronous calls are executed from same scenario one after another!
    I lost my session after the "Login". Is there any way in PI 7.0 to maintain the session?
    Note: I tried the same scenario using XML SPY SOAP client, it is working!!!  it is maintaining the session between multiple webservice calls.
    Is there any suggestions to overcome this problem?
    Thanks and regards,
    Satish.

    Hi Satish,
       We are working on the same sort of scenarios, where we have to call more than one webservice in a sequential fashion using the same session id details.
        What we did was we built new xsds adding session details node using the webserive request and response xsds. And we are maintaining a sessions table which contains session id and  status fields in PI. So we send webservice request with the session id details. We wrote an UDF to get the session details from PI and set the status field as busy so that no other request uses the same session details.
       Webserive response again contains the sessions details which can be used for the next webservice request.
      Finally after all the calls set back the status to Active in PI table.
    Webservice Calls From a User Defined Function
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    Hope this helps.
    Thanks,
    Vijaya.

  • SSDT vs 2013 and Clr function, call a Clr method name dynamically using SQLCMD variables

    Hello,
    My question is this, hopefully this makes sense:
    How could I got about doing this, inside a SQL function, I would like to re-name the Clr method call based on a SQLCMD variable? 
    I have a Clr project to encrypt/decrypt data, there are different method names depending on the deployment types.
    For the definition of a function called dbo.EncryptThis, I would like to use a SQLCMD variable to change the name depending on SQLCMD variables. This works fine in SQL Server Mgmt studio, but VS 2013 fails to recognize the SQLCMD variable and the build fails
    with: "Error
    1
    SQL71521: A method with a matching signature was not found in the loaded assembly.".
    THis code works fine in SQL Server Mgmt Studio, but fails to build in the SSDT project.
    In the SSDT project I have the SQLCMD variable defined and think I have SQLCMD mode enabled, by doing this:
    Right click file > Execution Settings > SQLCMD mode
    CREATE FUNCTION [dbo].[EncryptData]
    (@str NVARCHAR (MAX))
    RETURNS NVARCHAR (MAX)
    AS
    EXTERNAL NAME [CryptoClrAssembly].[LibName].[EncryptData$(MethodName)]
    Is this even possible in SSDT? or would I have to do this in a post-deploy script?

    Hi Kevin,
    Thanks for the info.
    Bummer, so the only other solution I have is to create a post-deploy script to change the function based on a SQLCMD variable or other logic?
    What would be really cool, would be if during the build process the SQLCMD variables would get replaced with the default value to the SQLCMD variable, thus would allow to build the project. Also, during deployment, if someone entered an incorrect method
    from the assembly it would just fail.

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

  • IR report value from function error

    i have ir report and one column value coming from function,when open the IR report its giving error..
    IR report code
    SELECT CS_ID ,CS_NAME, Util_func(PASS_ID) as "ALERT_DAYS"   from "CSD_MASTERS" Function code
    FUNCTION  Util_func(PASS_ID NUMBER) RETURN number
      IS
    ALERT_DAYS NUMBER:=0;
      BEGIN
       select TO_DATE(CDS_DATE,'DD-MM-YYYY') - TO_DATE(SYSDATE,'DD-MM-YYYY')  
      INTO ALERT_DAYS
       from   CDS_TABBLE
    where   CDS_ID=PASS_ID AND 
    CDS_DATE   between
       sysdate and sysdate+15
       group by  CDS_DATE  HAVING COUNT(*)  <=1  ; 
         IF RECCOUNT>0 THEN
            RETURN ALERT_DAYS;
         ELSE
           RETURN 'null';
         END IF;
      END;function calling CDS_TABBLE value
    CDS_ID -- CDS_DATE
    123 -- -- 4/23/2013
    124 -- -- 4/24/2013
    125 -- -- 4/25/2013
    Thanx,
    Ram
    Edited by: Ramani_vadakadu on Apr 11, 2013 8:56 PM

    FUNCTION  Util_func(PASS_ID NUMBER) RETURN number
    IS
        ALERT_DAYS NUMBER:=0;
        CURSOR lcsr_GetAlertDayCount IS
             select TO_DATE(CDS_DATE,'DD-MM-YYYY') - TO_DATE(SYSDATE,'DD-MM-YYYY')   
            from   CDS_TABBLE
            where   CDS_ID=PASS_ID AND 
                    CDS_DATE   between sysdate and sysdate+15
            group by  CDS_DATE  HAVING COUNT(*)  <=1;         
    BEGIN
        OPEN lcsr_GetAlertDayCount;
        FETCH lcsr_GetAlertDayCount INTO ALERT_DAYS;
        CLOSE lcsr_GetAlertDayCount;
        RETURN ALERT_DAYS;
    END;

  • Error while transporting objects:Internal error during pvc call: Parameter

    Dear all,
    We are facing the following error while transporting the individual configuration objects from our PI development system.
    Export failed: Internal error during pvc call: Parameter versionSpecifier or version has the invalid value null .
    However, it works fine when the complete configuration scenario is transported.
    We tried to transport the objects with different user id's, even then the issue still exists.
    Any inputs to resolve this will be highly helpful.
    Thank you,
    Younus

    Hi Mohammed,
    Answer is inside this oss [Note 1554387 - Error during export from Integration Directory|https://service.sap.com/sap/support/notes/1554387]. In this oss note, solution is to apply a patch (just a patch, not a SP). as it's a litle sap bug...
    Note: your issue is also explained with picture in this one "1550549 - PI transport: Internal error during pvc call" (sorry for this one I cannot insert a link)
    regards
    Mickael
    Edited by: Mickael Huchet on Jan 26, 2012 2:50 PM

Maybe you are looking for

  • Yoga 2 Pro 13.3 Android Poor Battery Life

    I am getting between 7 and 8 hours battery life out of my new Yoga Pro 2 13.3" Android tablet just browsing the internet with the screen set to 25% brightness (auto-brightness turned off) and no sound. The power saving screen and GPU settings are tur

  • Is there an app that sends photos from iPad to specific folders on your computer?

    Hello, Sometimes I have screenshots of websites or other saved images on my iPad 2. What I do now is sync my iPad to my iMac once in a while and rename the photos on my computer, after which I place the photos in their respective folders. I was wonde

  • The  in-built length variable

    The length variable we see in arrays and everywhere is built in some inbuilt class of java.. but where???? i tried to find it but cudnt get to it in any classses// tried searchin in java.lang package... can anyone tell me where the lenght variable is

  • Installing Intel 330 SSD in Mini 311c / Windows XP

    I've recently installed a 120GB Intel 330 series SSD into my old Mini 311c-1101SA running Windows XP. I believe the motherboard has a Nvidia 730i chipset (GFX card is Nvidia ION LE). Installation went fine and everything is up and running. I aligned

  • Various Account Assignment options while creating new Bid Invitation

    Dear Guru's, It seems while creating fresh Bid Invitation there is no option to define the Cost assignment like Cost Center, Asset, Order, Project, Network. System creates Bid Invitation only for Cost Assignment "CC - Cost Center". Is my understandin