Assign SQL select result to a java variable

In a custom IKM, I need to check the LOGGING setting of target table, save the setting, then change the setting, then restore the setting.
I am having problem saving the setting. I do something like the following, where tgtLogging is the current LOGGING setting of the target table. I need to save the value to sTgtLogging so that it can be accessed in a later step. I can't figure out the syntax. just saying sTgtLogging = tgtLogging does not work either in the pl/sql or the <% %> context.
<%
String sTgtLogging = "";
%>
declare
tgtLogging varchar(5);
begin
select logging into tgtLogging from dba_tables where table_name='<%=odiRef.getPop("TABLE_NAME")%>';
some other code.....
end;
Edited by: user611482 on Jul 8, 2010 3:34 PM

Hi,
we use this for saving the login time of the user. There are few therads about creating a custom login module (for example: [Custom Login Module - how to go on |http://forums.sdn.sap.com/thread.jspa?threadID=357616]).
We have created a login module which extends AbstractLoginModule, in login() method :
public boolean login() throws LoginException  {
Object option = g_sharedState.get("javax.security.auth.login.name");
if (option != null && !option.equals(""))  {
  String l_userID = (String)option;
  IUserAccount l_account = UMFactory.getUserAccountFactory().getUserAccountByLogonId(l_userID);
  IUserAccount mutableAccount = accountFactory.getMutableUserAccount(account.getUniqueID());     
  l_mutAccount.setLastSuccessfulLogonDate(new Date());
  l_mutAccount.commit();
about login modules and login stacks start here: [http://help.sap.com/saphelp_nw04/helpdata/en/8c/f03541c6afd92be10000000a1550b0/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/en/8c/f03541c6afd92be10000000a1550b0/frameset.htm]
Hope this helps,
Romano

Similar Messages

  • Sql (Select) result in string

    Hi , I found this code in internet but it´s put a result in range on excel. 
    I would like some code with end is some like  "MyVarString = objMySQLRecordsetResult"
    For example: In my select result = "User01" , I would like put this value in a var string.
    The code ends ...
            'ActiveSheet.Range("A1").CopyFromRecordset objMyRecordset
    I want ...
    Test01 = Recordset objMyRecordset
    tks for your help !!
    Public Sub GetDataFromADO()
        'Declare variables'
            Dim objMyConn As ADODB.Connection
            Dim objMyCmd As ADODB.Command
            Dim objMyRecordset As ADODB.Recordset
            Set objMyConn = New ADODB.Connection
            Set objMyCmd = New ADODB.Command
            Set objMyRecordset = New ADODB.Recordset
            Dim TESTE01 As String
        'Open Connection'
            objMyConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.15.0;Data Source="
    & ActiveWorkbook.Path & "\Database.accdb" & "; Jet OLEDB:Database Password= `MY PASSWORD"
            objMyConn.Open
        'Set and Excecute SQL Command'
            Set objMyCmd.ActiveConnection = objMyConn
            objMyCmd.CommandText = "select DUSER from DUSER WHERE DUSER = 'USUR01 "
            objMyCmd.CommandType = adCmdText
       'Open Recordset'
            Set objMyRecordset.Source = objMyCmd
            objMyRecordset.Open
            objMyRecordset.OpenRecordset
        'Copy Data to Excel'
            'ActiveSheet.Range("A1").CopyFromRecordset objMyRecordset
    End Sub

    Try:
    Public Sub GetDataFromADO()
    Dim Conn As New ADODB.Connection
    Dim Rs As New ADODB.Recordset
    'Open Connection'
    Conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.15.0;Data Source=" & ActiveWorkbook.Path & "\Database.accdb" & "; Jet OLEDB:Database Password= `MY PASSWORD"
    Conn.Open
    'Open Recordset'
    Rs.Open "select DUSER from DUSER WHERE DUSER = 'USUR01'", Conn, adOpenDynamic, adLockReadOnly
    'Copy Data to Excel'
    ActiveSheet.Range("A1").CopyFromRecordset Rs
    Rs.Close
    Conn.Close
    End Sub
    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

  • Assigning stored procedure output value to java variable

    I have one stored procedure which is having ref cursor as the output parameter.
    How to assign refcursor value to my java variable?

    cstmt.registerOutParameter(1, OracleTypes.CURSOR);
    cstmt.execute()
    ResultSet rs = (ResultSet)cstmt.getObject(1);
    ==
    Ashok

  • Need to get select result into a shell variable.

    Hi,
    I want to get below command output into a OS variable. Which will be used later in the shell script. Can you please advice how to go about it?
    VAR v_tool_execution_id NUMBER;
    EXEC :v_tool_execution_id := trcanlzr.trca$p.get_tool_execution_id;
    SELECT TO_CHAR(:v_tool_execution_id) tool_execution_id FROM DUAL;
    I can't do following
    VAR1=`sqlplus -s $unpwd <<EOF
    VAR v_tool_execution_id NUMBER;
    EXEC :v_tool_execution_id := trcanlzr.trca$p.get_tool_execution_id;
    SELECT TO_CHAR(:v_tool_execution_id) tool_execution_id FROM DUAL;
    EOF`
    Since tool execution is specific to session and exiting will not server my purpose since i need to run another command which generates a file name using tool execution id.
    Thanks for your time.
    Regards,
    Nagendra Chillale

    Actually the idea is the same. Instead of getting the variable into a shell script, call the shell script which use the variable from sqlplus. I attempted to include the line to call a shell script but had a mistake :P
    The last line should be
    SQL> host /path/to/second/part.sh &exec_idAnother way is to spool the variable into a file, then read the file into a variable in your shell script. You need to use head / tail command to extract the desired row, because Oracle adds blank lines, headers, etc in its spool output
    In your SQL script
    SQL> spool tool_execution_id.txt
    SQL> SELECT TO_CHAR(:v_tool_execution_id) tool_execution_id into :vtemp FROM DUAL;
    SQL> spool offIn your shell script (the desired line appeared in the second last line in my case)
    tool_execution_id=`tail -2 tool_execution_id.txt|head -1`
    echo $tool_execution_idEdited by: thtsang on Mar 30, 2010 11:43 AM

  • SQL SELECT result

    try {
    // Create a result set containing all data from my_table
        Statement s = connection.createStatement();
        ResultSet rs = s.executeQuery("SELECT * FROM station WHERE stationID = '" + stationID + "'");
    } catch (SQLException e) {
    }If there are no rows for that SQL statement, what will it return back to me? On my server, a client is sending a packet to me that contains the stationID. First, I want to make sure stationID already exists in the database. If it doesn't exist, I would like to run more SQL statements, but first I need to know what it will return to me.
    In guessing code, this is what I'm looking for: try {
    // Create a result set containing all data from my_table
        Statement s = connection.createStatement();
        ResultSet rs = s.executeQuery("SELECT * FROM station WHERE stationID = '" + stationID + "'");
        if (rs  == NULL) // if no rows were selected
            // if there were no rows selected from the original SELECT statement, INSERT a new row using this query
            ResultSet rs = s.executeQuery("INSERT INTO station VALUES ('stationID', 'address', 'city', 'state', zip'");
    } catch (SQLException e) {
    }Any help?
    Message was edited by:
    tristanlee85

    Why would you guess when you can just look at the API documentation? (Which specifically says the executeQuery() method never returns null.)
    If the SQL statement returns zero rows, you get a ResultSet that contains zero rows. Does that seem peculiar to you? In that case calling "rs.next()" returns false because there are zero rows.

  • Assigning javascript variables to java variables in JSP

    Does anyone know if it possible to assign a javascript value to a java variable in a javascript function? I want to be able to use the javascript value in a PreparedStatement call, but I can't assign the value of the javascript variable to a java variable. I know the opposite can be done using hidden variables in the form, but I need:
    javascript -> java variable in a JSP scriptlet.
    Any help would be much appreciated,
    Thanks,
    -Dave

    Can't do that.
    html/javascript is in the client side.
    jsp is in the server side.
    In order to put html/javascript values (client side) into jsp (server side) it must be submitted.
    Try remoting. Using an iframe with a jsp as the source of it and the html target pointing at it.
    -------------

  • Assign a value to an ODI or Java variable in a KM

    Hi Gurus,
    I'm developing a new KM and I need to get the name of a dblink by calling an Oracle function. How to store the result of a function in an ODI or Java variable in a KM step ?
    And if it is in an Java variable, how to use it in this kind of step (line 7) :
    create or replace view <%=odiRef.getObjectNameDefaultPSchema("L", "" , "W")%><%=odiRef.getInfo("COLL_NAME")%>
         <%=odiRef.getColList("", "[CX_COL_NAME]", ",\n\t", "", "")%>
    as select     <%=odiRef.getPop("DISTINCT_ROWS")%>
         <%=odiRef.getColList("", "[EXPRESSION]", ",\n\t", "", "")%>
    from     <%=odiRef.getSrcTablesList("", "[SCHEMA].[RES_NAME]@"+++*#PROJECT.VARIABLE*+++" [POP_TAB_ALIAS]", ", ", "")%>
    where     (1=1)
    <%=odiRef.getFilter()%>
    <%=odiRef.getJrnFilter()%>
    <%=odiRef.getJoin()%>
    <%=odiRef.getGrpBy()%>
    <%=odiRef.getHaving()%>
    Thanks a lot for your help.
    Best regards

    If it is java variable then your code should looks like this
    create or replace view <%=odiRef.getObjectNameDefaultPSchema("L", "" , "W")%><%=odiRef.getInfo("COLL_NAME")%>
    <%=odiRef.getColList("", "[CX_COL_NAME]", ",\n\t", "", "")%>
    as select     <%=odiRef.getPop("DISTINCT_ROWS")%>
    <%=odiRef.getColList("", "[EXPRESSION]", ",\n\t", "", "")%>
    from     <%=odiRef.getSrcTablesList("", "[SCHEMA].[RES_NAME]@ *<@=java_variable_name@>* [POP_TAB_ALIAS]", ", ", "")%>
    where     (1=1)
    <%=odiRef.getFilter()%>
    <%=odiRef.getJrnFilter()%>
    <%=odiRef.getJoin()%>
    <%=odiRef.getGrpBy()%>
    <%=odiRef.getHaving()%>
    If it is odi variable then your code should looks like this
    create or replace view <%=odiRef.getObjectNameDefaultPSchema("L", "" , "W")%><%=odiRef.getInfo("COLL_NAME")%>
    <%=odiRef.getColList("", "[CX_COL_NAME]", ",\n\t", "", "")%>
    as select     <%=odiRef.getPop("DISTINCT_ROWS")%>
    <%=odiRef.getColList("", "[EXPRESSION]", ",\n\t", "", "")%>
    from     <%=odiRef.getSrcTablesList("", "[SCHEMA].[RES_NAME]@ *#odi_variable_name* [POP_TAB_ALIAS]", ", ", "")%>
    where     (1=1)
    <%=odiRef.getFilter()%>
    <%=odiRef.getJrnFilter()%>
    <%=odiRef.getJoin()%>
    <%=odiRef.getGrpBy()%>
    <%=odiRef.getHaving()%>

  • JBO-27122: SQL error during statement preparation IN OAF(java.sql.SQLException: ORA-01008: not all variables bound)

    Hi Friends,
    I have have extended CO where i have added dynamic where condition to VO,it's throwing error.
    Code added in controller :
    public class Custom_HomePageCO extends HomePageCO
      public Custom_HomePageCO()
    public void processRequest(OAPageContext pageContext,OAWebBean webBean)
      super.processRequest(pageContext,webBean);
      System.out.println("NewClase");
      OAApplicationModule am=pageContext.getApplicationModule(webBean);
      System.out.println(am);
      OAApplicationModule am1=(OAApplicationModule)am.findApplicationModule("TrackExpenseReportsAM");
    System.out.println(am1);
      OAViewObject vo=(OAViewObject)am1.findViewObject("TrackExpenseReportsVO");
      System.out.println(vo);
      vo.setWhereClause("REPORT_SUBMITTED_DATE is not null");
        vo.executeQuery();
    public void processFormRequest(OAPageContext pageContext,OAWebBean webBean)
      super.processFormRequest(pageContext,webBean);
    Error message:
    Exception Details.
    Error Details
           Logout
          Error Page
          Exception Details.
    oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.  Statement: SELECT * FROM (SELECT
    AI.DESCRIPTION PURPOSE,
    AI.INVOICE_CURRENCY_CODE CURRENCY_CODE,
    AI.INVOICE_DATE REPORT_DATE,
    AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
    AI.INVOICE_NUM REPORT_NUMBER,
    TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
                     0, decode(AI.CANCELLED_DATE,
                                 null, APS.GROSS_AMOUNT,
                                 AERH.TOTAL),
                   nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,  
            FND_CURRENCY_CACHE.GET_FORMAT_MASK
            (AI.INVOICE_CURRENCY_CODE, 30)) ||' '|| AI.INVOICE_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
    TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
                     0, decode(AI.CANCELLED_DATE,
                                 null, APS.GROSS_AMOUNT,
                                 AERH.TOTAL),
                   nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,  
            FND_CURRENCY_CACHE.GET_FORMAT_MASK
            (AI.INVOICE_CURRENCY_CODE, 30))
    REPORT_TOTAL,
    P.PERSON_ID EMPLOYEE_ID,
    AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
    P.FULL_NAME FULL_NAME ,
    DECODE(AI.CANCELLED_DATE,null,
                              nvl(aerh.expense_status_code, DECODE(APS.GROSS_AMOUNT ,0,'PAID',
                                    decode(AI.Payment_status_flag,'Y','PAID',
                                                            'N','INVOICED',
                                                            'P','PARPAID',NULL))),
                                            'CANCELLED') STATUS_CODE,
    AERH.source SOURCE,
    NULL CURRENT_APPROVER,
    ROUND(sysdate - AI.LAST_UPDATE_DATE) DAYS_SINCE_ACTIVITY,
    AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
    AERH.HOLDING_REPORT_HEADER_ID,
    AI.VENDOR_ID VENDOR_ID,
    AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
    AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,         
    'CurrentApproverName' CURRENT_APPROVER_SWITCHER,
    to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
    AI.INVOICE_ID INVOICE_ID
    FROM
           AK_WEB_USER_SEC_ATTR_VALUES A,
           PO_VENDORS PV,
           AP_INVOICES AI,
           AP_EXPENSE_REPORT_HEADERS AERH,
           PER_PEOPLE_X P,
           AP_PAYMENT_SCHEDULES APS
    WHERE  AI.INVOICE_ID= APS.INVOICE_ID
    AND    AI.INVOICE_ID = AERH.VOUCHNO(+)
    AND AI.INVOICE_TYPE_LOOKUP_CODE||'' = 'EXPENSE REPORT'
    AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
    AND PV.EMPLOYEE_ID = A.NUMBER_VALUE
    AND A.WEB_USER_ID = :1
    AND P.PERSON_ID = PV.EMPLOYEE_ID
    AND PV.VENDOR_ID = AI.VENDOR_ID
    AND DECODE (AI.PAYMENT_STATUS_FLAG,
             'Y', sysdate - AI.LAST_UPDATE_DATE,
            decode(APS.GROSS_AMOUNT , 0 ,sysdate - AI.LAST_UPDATE_DATE,0)
              )  <= 30
    AND (AERH.SOURCE <> 'Both Pay' OR AERH.REPORT_HEADER_ID IS NULL)       
    UNION
    SELECT
    AI.DESCRIPTION PURPOSE,
    AI.INVOICE_CURRENCY_CODE CURRENCY_CODE,
    AI.INVOICE_DATE REPORT_DATE,
    AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
    AI.INVOICE_NUM REPORT_NUMBER,
    TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
                     0, decode(AI.CANCELLED_DATE,
                                 null, APS.GROSS_AMOUNT,
                                 AERH.TOTAL),
                   nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,  
            FND_CURRENCY_CACHE.GET_FORMAT_MASK
            (AI.INVOICE_CURRENCY_CODE, 30)) ||' '|| AI.INVOICE_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
    TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
                     0, decode(AI.CANCELLED_DATE,
                                 null, APS.GROSS_AMOUNT,
                                 AERH.TOTAL),
                   nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)),  
            FND_CURRENCY_CACHE.GET_FORMAT_MASK
            (AI.INVOICE_CURRENCY_CODE, 30))
    REPORT_TOTAL,
    P.PERSON_ID EMPLOYEE_ID,
    AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
    P.FULL_NAME FULL_NAME ,
    DECODE(AI.CANCELLED_DATE,null,
                              nvl(aerh.expense_status_code, DECODE(APS.GROSS_AMOUNT ,0,'PAID',
                                    decode(AI.Payment_status_flag,'Y','PAID',
                                                            'N','INVOICED',
                                                            'P','PARPAID',NULL))),
                                            'CANCELLED') STATUS_CODE,
    AERH.source SOURCE,
    NULL CURRENT_APPROVER,
    ROUND(sysdate - AI.LAST_UPDATE_DATE) DAYS_SINCE_ACTIVITY,
    AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
    AERH.HOLDING_REPORT_HEADER_ID,
    AI.VENDOR_ID VENDOR_ID,
    AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
    AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,         
    'CurrentApproverName' CURRENT_APPROVER_SWITCHER,
    to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
    AI.INVOICE_ID INVOICE_ID
    FROM
           AK_WEB_USER_SEC_ATTR_VALUES A,
           PO_VENDORS PV,
           AP_INVOICES AI,
           AP_EXPENSE_REPORT_HEADERS AERH,
           PER_PEOPLE_X P,
           AP_PAYMENT_SCHEDULES APS
    WHERE  AI.INVOICE_ID= APS.INVOICE_ID
    AND    AI.INVOICE_ID = AERH.VOUCHNO(+)
    AND AI.INVOICE_TYPE_LOOKUP_CODE||'' in ('STANDARD','MIXED')
    AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
    AND AI.PAID_ON_BEHALF_EMPLOYEE_ID = A.NUMBER_VALUE
    AND A.WEB_USER_ID = :2
    AND P.PERSON_ID = AI.PAID_ON_BEHALF_EMPLOYEE_ID
    AND PV.VENDOR_ID = AI.VENDOR_ID
    AND DECODE (AI.PAYMENT_STATUS_FLAG,
             'Y', sysdate - AI.LAST_UPDATE_DATE,
            decode(APS.GROSS_AMOUNT , 0 ,sysdate - AI.LAST_UPDATE_DATE,0)
            ) <= 30
    AND (AERH.SOURCE <> 'Both Pay' OR AERH.REPORT_HEADER_ID IS NULL)            
    UNION ALL
    SELECT
    AERH.DESCRIPTION PURPOSE,
    AERH.DEFAULT_CURRENCY_CODE CURRENCY_CODE,
    AERH.WEEK_END_DATE REPORT_DATE,
    AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
    AERH.INVOICE_NUM REPORT_NUMBER,
    TO_CHAR(nvl(AERH.AMT_DUE_CCARD_COMPANY+AERH.AMT_DUE_EMPLOYEE+nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),AERH.TOTAL),FND_CURRENCY_CACHE.GET_FORMAT_MASK
      (AERH.DEFAULT_CURRENCY_CODE,30)) ||' '|| AERH.DEFAULT_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
    TO_CHAR(nvl(AERH.AMT_DUE_CCARD_COMPANY+AERH.AMT_DUE_EMPLOYEE+nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),AERH.TOTAL),FND_CURRENCY_CACHE.GET_FORMAT_MASK
      (AERH.DEFAULT_CURRENCY_CODE,30)) REPORT_TOTAL,
    PER_EMPLOYEE.PERSON_ID EMPLOYEE_ID,
    AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
    PER_EMPLOYEE.FULL_NAME FULL_NAME,
    NVL(AERH.expense_status_code,
      AP_WEB_OA_ACTIVE_PKG.GetReportStatusCode(AERH.Source, AERH.Workflow_approved_flag,
      AERH.report_header_id, 'Y', 'N')) STATUS_CODE,
    AERH.source SOURCE,
    NVL (PER_APPROVER.full_name, AP_WEB_OA_ACTIVE_PKG.GetCurrentApprover(AERH.Source,
            AERH.Workflow_approved_flag, AERH.report_header_id, AERH.expense_status_code)) CURRENT_APPROVER,
    ROUND(NVL(sysdate - AERH.EXPENSE_LAST_STATUS_DATE,
              sysdate - AERH.LAST_UPDATE_DATE)) DAYS_SINCE_ACTIVITY,
    AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
    AERH.HOLDING_REPORT_HEADER_ID,
    0 VENDOR_ID,
    AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
    AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,  
    DECODE(AERH.expense_current_approver_id,
    -99999, 'AMEMultipleApprovers',
    decode(PER_APPROVER.full_name,
      null,'CurrentApproverName','AMESingleApprover')) CURRENT_APPROVER_SWITCHER,
    to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
    -1 INVOICE_ID
    FROM
           AK_WEB_USER_SEC_ATTR_VALUES A,
           AP_EXPENSE_REPORT_HEADERS AERH,
           PER_PEOPLE_X PER_EMPLOYEE,
           PER_PEOPLE_X PER_APPROVER
    WHERE  AERH.VOUCHNO +0 =0
    AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
    AND AERH.EMPLOYEE_ID = A.NUMBER_VALUE
    AND A.WEB_USER_ID = :3
    AND PER_EMPLOYEE.PERSON_ID = AERH.EMPLOYEE_ID
    AND (AERH.Source <> 'NonValidatedWebExpense'
         OR AERH.Workflow_approved_flag IS NULL)
    AND AERH.expense_current_approver_id = PER_APPROVER.person_id
    AND decode(AERH.total,0,ROUND(NVL(sysdate - AERH.EXPENSE_LAST_STATUS_DATE,sysdate - AERH.LAST_UPDATE_DATE)),30) <= 30
    AND AERH.SOURCE <> 'Both Pay'
    UNION
    SELECT
    AERH.DESCRIPTION PURPOSE,
    AERH.DEFAULT_CURRENCY_CODE CURRENCY_CODE,
    AERH.WEEK_END_DATE REPORT_DATE,
    AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
    AERH.INVOICE_NUM REPORT_NUMBER,
    TO_CHAR(nvl(AERH.AMT_DUE_CCARD_COMPANY+AERH.AMT_DUE_EMPLOYEE+nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),AERH.TOTAL),FND_CURRENCY_CACHE.GET_FORMAT_MASK
      (AERH.DEFAULT_CURRENCY_CODE,30)) ||' '|| AERH.DEFAULT_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
    TO_CHAR(nvl(AERH.AMT_DUE_CCARD_COMPANY+AERH.AMT_DUE_EMPLOYEE+nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),AERH.TOTAL),FND_CURRENCY_CACHE.GET_FORMAT_MASK
      (AERH.DEFAULT_CURRENCY_CODE,30)) REPORT_TOTAL,
    PER_EMPLOYEE.PERSON_ID EMPLOYEE_ID,
    AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
    PER_EMPLOYEE.FULL_NAME FULL_NAME,
    NVL(AERH.expense_status_code,
      AP_WEB_OA_ACTIVE_PKG.GetReportStatusCode(AERH.Source, AERH.Workflow_approved_flag,
      AERH.report_header_id,'Y','N')) STATUS_CODE,
    AERH.source SOURCE,
    NVL (PER_APPROVER.full_name, AP_WEB_OA_ACTIVE_PKG.GetCurrentApprover(AERH.Source,
            AERH.Workflow_approved_flag, AERH.report_header_id, AERH.expense_status_code)) CURRENT_APPROVER,
    ROUND(NVL(sysdate - AERH.EXPENSE_LAST_STATUS_DATE,
              sysdate - AERH.LAST_UPDATE_DATE)) DAYS_SINCE_ACTIVITY,
    AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
    AERH.HOLDING_REPORT_HEADER_ID,
    0 VENDOR_ID,
    AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
    AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,  
    DECODE(AERH.expense_current_approver_id,
    -99999, 'AMEMultipleApprovers',
    decode(PER_APPROVER.full_name,
      null,'CurrentApproverName','AMESingleApprover')) CURRENT_APPROVER_SWITCHER,
    to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
    -1 INVOICE_ID
    FROM
           AK_WEB_USER_SEC_ATTR_VALUES A,
           AP_EXPENSE_REPORT_HEADERS AERH,
           PER_PEOPLE_X PER_EMPLOYEE,
           PER_PEOPLE_X PER_APPROVER
    WHERE  AERH.VOUCHNO +0=0
    AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
    AND AERH.PAID_ON_BEHALF_EMPLOYEE_ID = A.NUMBER_VALUE
    AND A.WEB_USER_ID = :4
    AND PER_EMPLOYEE.PERSON_ID = PAID_ON_BEHALF_EMPLOYEE_ID
    AND AERH.EMPLOYEE_ID IS NULL
    AND (AERH.Source <> 'NonValidatedWebExpense'
         OR AERH.Workflow_approved_flag IS NULL)
    AND AERH.expense_current_approver_id = PER_APPROVER.person_id
    AND decode(AERH.total,0,ROUND(NVL(sysdate - AERH.EXPENSE_LAST_STATUS_DATE,sysdate - AERH.LAST_UPDATE_DATE)),30) <= 30
    AND AERH.SOURCE <> 'Both Pay'
    UNION ALL
    /* This select is for invoice imported reports by contingent workers */
    SELECT
    AI.DESCRIPTION PURPOSE,
    AI.INVOICE_CURRENCY_CODE CURRENCY_CODE,
    AI.INVOICE_DATE REPORT_DATE,
    AERH.REPORT_SUBMITTED_DATE REPORT_SUBMITTED_DATE,
    AI.INVOICE_NUM REPORT_NUMBER,
    TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
                     0, decode(AI.CANCELLED_DATE,
                                 null, APS.GROSS_AMOUNT,
                                 AERH.TOTAL),
                   nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,  
            FND_CURRENCY_CACHE.GET_FORMAT_MASK
            (AI.INVOICE_CURRENCY_CODE, 30)) ||' '|| AI.INVOICE_CURRENCY_CODE REPORT_TOTAL_CURRENCY,
    TO_CHAR(decode(nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0),
                     0, decode(AI.CANCELLED_DATE,
                                 null, APS.GROSS_AMOUNT,
                                 AERH.TOTAL),
                   nvl(AI.AMT_DUE_CCARD_COMPANY, AERH.AMT_DUE_CCARD_COMPANY) + nvl(AI.AMT_DUE_EMPLOYEE, AERH.AMT_DUE_EMPLOYEE) + nvl(AERH.MAXIMUM_AMOUNT_TO_APPLY,0)) ,  
            FND_CURRENCY_CACHE.GET_FORMAT_MASK
            (AI.INVOICE_CURRENCY_CODE, 30))
    REPORT_TOTAL,
    P.PERSON_ID EMPLOYEE_ID,
    AERH.REPORT_HEADER_ID REPORT_HEADER_ID,
    P.FULL_NAME FULL_NAME ,
    DECODE(AI.CANCELLED_DATE,null,
                              nvl(aerh.expense_status_code, DECODE(APS.GROSS_AMOUNT ,0,'PAID',
                                    decode(AI.Payment_status_flag,'Y','PAID',
                                                            'N','INVOICED',
                                                            'P','PARPAID',NULL))),
                                            'CANCELLED') STATUS_CODE,
    AERH.source SOURCE,
    NULL CURRENT_APPROVER,
    ROUND(sysdate - AI.LAST_UPDATE_DATE) DAYS_SINCE_ACTIVITY,
    AERH.RECEIPTS_STATUS RECEIPTS_STATUS_CODE,
    AERH.HOLDING_REPORT_HEADER_ID,
    AI.VENDOR_ID VENDOR_ID,
    AERH.AMT_DUE_CCARD_COMPANY AMT_DUE_CCARD_COMPANY,
    AERH.AMT_DUE_EMPLOYEE AMT_DUE_EMPLOYEE,          
    'CurrentApproverName' CURRENT_APPROVER_SWITCHER,
    to_char(AERH.LAST_UPDATE_DATE, 'DD-MON-RRRR HH:MI:SS'),
    AI.INVOICE_ID INVOICE_ID
    FROM
           AK_WEB_USER_SEC_ATTR_VALUES A,
           AP_INVOICES AI,
           AP_EXPENSE_REPORT_HEADERS AERH,
           PER_PEOPLE_X P,
           AP_PAYMENT_SCHEDULES APS
    WHERE  AI.INVOICE_ID= APS.INVOICE_ID
    AND    AI.INVOICE_ID = AERH.VOUCHNO(+)
    AND AI.INVOICE_TYPE_LOOKUP_CODE||'' = 'EXPENSE REPORT'
    AND A.ATTRIBUTE_CODE = 'ICX_HR_PERSON_ID'
    AND AI.PAID_ON_BEHALF_EMPLOYEE_ID = A.NUMBER_VALUE
    AND A.WEB_USER_ID = :5
    AND P.PERSON_ID = AI.PAID_ON_BEHALF_EMPLOYEE_ID
    AND AP_WEB_DB_HR_INT_PKG.IsPersonCwk(AI.PAID_ON_BEHALF_EMPLOYEE_ID)='Y'
    AND DECODE (AI.PAYMENT_STATUS_FLAG,
             'Y', sysdate - AI.LAST_UPDATE_DATE,
            decode(APS.GROSS_AMOUNT , 0 ,sysdate - AI.LAST_UPDATE_DATE,0)
              )  <= 30
    AND (AERH.SOURCE <> 'Both Pay' OR AERH.REPORT_HEADER_ID IS NULL)) QRSLT  WHERE (REPORT_SUBMITTED_DATE is not null)
    at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:891)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:603)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
    at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2360)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1759)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:511)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:432)
    at _OA._jspService(OA.jsp:33)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01008: not all variables bound
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
    at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2548)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2933)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:578)
    at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:631)
    at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:518)
    at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3375)
    at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)
    at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4525)
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
    at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
    at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3339)
    at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3326)
    at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:441)
    at oracle.apps.ap.oie.webui.Custom_HomePageCO.processRequest(Custom_HomePageCO.java:26)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
    at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2360)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1759)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:511)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:432)
    at _OA._jspService(OA.jsp:33)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    java.sql.SQLException: ORA-01008: not all variables bound
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
    at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1144)
    at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2548)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2933)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:650)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:578)
    at oracle.jbo.server.QueryCollection.buildResultSet(QueryCollection.java:631)
    at oracle.jbo.server.QueryCollection.executeQuery(QueryCollection.java:518)
    at oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(ViewObjectImpl.java:3375)
    at oracle.jbo.server.OAJboViewObjectImpl.executeQueryForCollection(OAJboViewObjectImpl.java:828)
    at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQueryForCollection(OAViewObjectImpl.java:4525)
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:574)
    at oracle.jbo.server.ViewRowSetImpl.execute(ViewRowSetImpl.java:544)
    at oracle.jbo.server.ViewRowSetImpl.executeDetailQuery(ViewRowSetImpl.java:619)
    at oracle.jbo.server.ViewObjectImpl.executeDetailQuery(ViewObjectImpl.java:3339)
    at oracle.jbo.server.ViewObjectImpl.executeQuery(ViewObjectImpl.java:3326)
    at oracle.apps.fnd.framework.server.OAViewObjectImpl.executeQuery(OAViewObjectImpl.java:441)
    at oracle.apps.ap.oie.webui.Custom_HomePageCO.processRequest(Custom_HomePageCO.java:26)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:587)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processRequest(OAPageLayoutHelper.java:1136)
    at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processRequest(OAPageLayoutBean.java:1569)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processRequest(OAFormBean.java:385)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:959)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequestChildren(OAWebBeanHelper.java:926)
    at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processRequest(OAWebBeanHelper.java:646)
    at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processRequest(OAWebBeanContainerHelper.java:247)
    at oracle.apps.fnd.framework.webui.beans.OABodyBean.processRequest(OABodyBean.java:353)
    at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2360)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1759)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:511)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:432)
    at _OA._jspService(OA.jsp:33)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
    at java.lang.Thread.run(Thread.java:534)
    I have took the sql from error message and i tried executing the same in toad... i was able execute it smoothly... i dot know why its working while running the page
    Please help me guys...
    Thanks,
    Pavan

    Hi Shobhi,
    Actually this relates to the Iexpenese Module. The VO is "oracle.apps.ap.oie.server.TrackExpenseReportsVO"(Seeded)
    The user Expense home screen is based on the above VO and this view returning multiple line for the same expense number which should be eliminated.
    so for this i need to filter data by adding where clause dynamically on top of the existing where conditions so that i can eliminate the duplicate row.
    Please suggest me !! how to move on
    Thanks,
    Pavan V
    91-9640871542

  • Concat java variable to a MySql select statement and exeucte

    Hi,
    I am trying to append a variable to a MySql select statement.
    Overview: I need to retrieve data from a MySql database with a java variable as a reference and select the data in the database based on that variable.
    CODE THAT I CURRENTLY HAVE:
    // Declare variables
    Connection conn = null;
    Statement st = null;
    Resultset rs2 = null;
    String st2 = null;
    String keyid = null;
    // Connect to database
    try {
          Class.forName("org.gjt.mm.mysql.Driver").newInstance();
          conn = DriverManager.getConnection("jdbc:mysql://" + mysql_host + ":3306/" + mysql_database, mysql_login, mysql_password);
          st = conn.createStatement();
          // Select data in Database with hanging equal sign
          st2 = ("SELECT * FROM table WHERE keyid= ");
          // Append keyid to hanging equal sign of select statement
          rs2 = st.executeQuery(st2 + keyid);
    }This is not working when I try to display the data.

    What is not working about it? Is there an error message? Stack Trace?
    Where do you get the value of keyId from?
    I would suggest that you use a prepared statement rather than building up a sql string like this. It prevents sql injection attacks
    // Declare variables
    Connection conn = null;
    PreparedStatement stmt = null;
    Resultset rs2 = null;
    String sql= null;
    String keyid = null;
    // Connect to database
    try {
          Class.forName("org.gjt.mm.mysql.Driver").newInstance();
          conn = DriverManager.getConnection("jdbc:mysql://" + mysql_host + ":3306/" + mysql_database, mysql_login, mysql_password);
          // Select data in Database with place holder for parameter
          sql = "SELECT * FROM table WHERE keyid= ?";
           // prepare the statement
          stmt = conn.prepareStatement(sql);
          // set the value of key id to use with the query
          stmt.setString(1, keyId);
          // run the query
          rs2 = st.executeQuery();
    catch (Exception e){
      System.out.println("An error occurred " + e.getMessage());
      e.printStackTrace();
    finally{
      if (rs2 != null) try { rs2.close(); } catch(SQLException ex){}
      if (stmt != null) try { stmt.close(); } catch(SQLException ex){}
      if (conn != null) try { con.close(); } catch(SQLException ex){}
    }

  • Java Variable Assignment from ODI Proc

    Hello,
    I have a requirement of purging the records in a set of table in DB.
    The table list to be purged is maintained in a Table Custom_Tab_List. Addition to that I need to record the total number of records deleted in another Logging table for this session.
    Wrote an ODI Procedure for the same.
    <b>Command on Source</b>
    Select table_name from custom_tab_list<b>Command on Target</b>
    delete from #table_nameFor additional Number of Counts thought of adding a Java Variable which would be global to the session. So added Step 1 in procedure
    <@ java.lang.Integer V_Count @>
    Step 2 of the Procedure
    <b>Command on Source</b>
    Select table_name from custom_tab_list<b>Command on Target</b>
    DECLARE
    v_c number;
    BEGIN
    select count(*) into v_c from #table_name;
    <@V_Count@>:= v_c+ <@out.println.(V_Count); @>;
    delete from #table_name;
    END;Not able to assignt the sql variable to the Java Variable. Is there any other way other than creating objects in the Database as an solution.

    I dont think that is possible. Two ways you can store the oracle value to a java variable.
    1.
    command on source, you can select the table name or any value with alias name
    command on target(java beanshell) just store the alias name as follows
    <@String java_v="SOURCE_ALIAS":@>
    2.
    You have to use the java program to do the dml operation as follows and retrieve the affected rows.
    not: I have not tested these codes but it will be allmost same. you just need to debug it.
    <@
    import java.sql.*;
    import java.lang.*;
    try {
    Connection myCon = snpRef.getJDBCConnection("SRC");
    Statement myStmt = myCon.createStatement();
    int cnt = myStmt.executeUpdate("delete from #SOURCE_ALIAS");
    catch(Exception s){
    System.out.println("Table is not exists!");
    myStmt .close();
    myCon.close();
    @>

  • Answer from a sql query into a java variable ?

    Hey!
    Got a simple question :
    String dml = ("INSERT INTO student " +
                                         "VALUES ( SELECT MAX(id) +1 FROM student "  +
                                         "','" + student.getFornavn() +
                                         "','" + student.getEtternavn() +
                                         "','" + student.getKlasse() + "')");This sql syntax would work in sql+ , but for some reason not in java.. Need to add 1 to max id every time new student are added , or is there any way i could make sql add a new unique nubmer when id = NULL ?
    The other solution could be to get the answer from SELECT MAX (id) + 1 into a java variable and use that number value in insert query ?
    Or maybe the best would be to make a procedure ?

    Thanks!
    How would the syntax be to execute this procedure in java :
    CREATE OR REPLACE PROCEDURE legg_til_student (p_fnavn student.fornavn%TYPE, p_enavn student.etternavn%TYPE, p_klasseid student.klasseid%TYPE) IS
    v_id student.id%TYPE;
    BEGIN
         SELECT MAX(id) +1 INTO v_id
         FROM student;     
         IF p_klasseid > 3 THEN
         DBMS_OUTPUT.PUT_LINE ('Ugyldig klasseid');
         ELSE
         INSERT INTO student VALUES (v_id, p_fnavn, p_enavn, p_klasseid);
         END IF;
    END;
    /Only this into a stmt sentence ? :
    exec legg_til_student ('Test', 'Test', 2); ? thanks :)

  • Assigning javascript varibel value to java variable

    Hi all
    I want to find screen resolution in one jsp page.That can be done in javascript.
    (though 'screen.width and screen.height')
    But is there any way to assign that value to java variable.
    Any body has the idea?
    Help me.

    No, why ? becuase jsp is SERVER side
    There are workarounds, You can store your javascript values in hidden fields and submit your page with them to your JSP and then use them like that

  • Assigning javascript varible value to java variable

    Hi all
    I want to find screen resolution in one jsp page.That can be done in javascript.
    (though 'screen.width and screen.height')
    But is there any way to assign that value to java variable.
    Any body has the idea?
    Help me.

    No, why ? becuase jsp is SERVER side
    There are workarounds, You can store your javascript values in hidden fields and submit your page with them to your JSP and then use them like that

  • Assign j_user value to a java variable in umLogonPage.jsp

    Hi All
    I need to do some post processing immediately after login and require the user id for the same. So how do we acess the value in the user id field and assign it to a java variable in the umLogonPage.jsp..??
    Java specific forums claim that this is not possible directly and can be only done on submit function or through hidden fields in the form. Any ideas with regard to the form that is present in umLogonPage.jsp..??
    Thanks
    Deepak

    Hi,
    we use this for saving the login time of the user. There are few therads about creating a custom login module (for example: [Custom Login Module - how to go on |http://forums.sdn.sap.com/thread.jspa?threadID=357616]).
    We have created a login module which extends AbstractLoginModule, in login() method :
    public boolean login() throws LoginException  {
    Object option = g_sharedState.get("javax.security.auth.login.name");
    if (option != null && !option.equals(""))  {
      String l_userID = (String)option;
      IUserAccount l_account = UMFactory.getUserAccountFactory().getUserAccountByLogonId(l_userID);
      IUserAccount mutableAccount = accountFactory.getMutableUserAccount(account.getUniqueID());     
      l_mutAccount.setLastSuccessfulLogonDate(new Date());
      l_mutAccount.commit();
    about login modules and login stacks start here: [http://help.sap.com/saphelp_nw04/helpdata/en/8c/f03541c6afd92be10000000a1550b0/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/en/8c/f03541c6afd92be10000000a1550b0/frameset.htm]
    Hope this helps,
    Romano

  • Colorize report results depending on sql selects

    Hy,
    is it possible to colorize report results depending on sql selects.
    For example: select id, name from db where name = 'frankfurt' or name = 'munic'
    All Results munic in red colour.
    Thanks
    Tom

    Hi,
    I have tried using the following in a decode statement of a Region report (type is SQL Query), and all it seems to do is form the HTML text as expected, but does not actually do what I want (i.e. display the field as red):-
    SELECT a_code, a_status, decode(a_fld,a_fld,'&ltfont color=&quotFF0000&quot&gt'||a_fld||'&lt/font&gt','other') "CA" from a_table
    What appears in the report is literally (I've put in single quotes in case this line is interpretted in the forum):
    '<font color="FF0000">1234</font>'
    I'm missing something - to force the HTML to be rendered as such. The field is displayed as a Standard Report Column, but it's just taking the decode search field as an ordinary piece of text. There's something that needs setting, but I can't find it - does anyone know?
    Thanks in advance
    Dave

Maybe you are looking for

  • How can I convert MPEGs without losing quality?

    Hi Guys Ok, to start, I have a MAC OS X 10.4.11/ Final Cut Pro 5/ new 1TB external hard-drive/ from UK So, I am new to FCP and not very tech savvy. Please be gentle with me.... Basically, I have some video files I would like to edit on FCP. They are

  • Streaming music from itunes

    can you stream music from a cd over the airport express from itunes without ripping tracks into a playlist

  • Any Orjinal SAP Reports which has currency field and currency key

    Hi Friends, I am looking for a report which has currency field and currency key at selection screen. I want to learn how SAP do selection with currency. Can you say a transaction deal with my desire? Thanks.

  • Group report without repeating group value

    I am trying to format my report that breaks by department like this: Dept ID Employee 1____1___BoB _____2___Mike _____3___John 2____4___Tim I don't want the 'Dept' field to repeat every line. Only where it is changed. I tried this, but ut shows the v

  • Browser navigation buttons not working?

    I should be able to use the number buttons on my E61 to go back, home etc. Not happening. Any suggestions?