Calling Database Functions

Hi All,
Just wondering whether anyone has experienced problems in calling a database function. We have Forte 3.0.L.2 and Oracle 8.1.7. Here's how the function is being called:
l_tdCurrentStatus = (SQL EXECUTE PROCEDURE me_status.get_status(input I_MCR_ID = theMember.CurMCR.MCR_ID) ON SESSION self.DefaultDBSession);
We are using SQL EXECUTE PROCEDURE syntax to call the function since there is no specific way to call functions.
We have tried calling the function in a SELECT clause and didn't face any issues so far. But I'd like to know the right way to call a function.
Any help is greatly appreciated.
Thanks,
Madhu
Fri Feb 13 15:40:21 : Database Error: Procedure me_status.get_status was invoked with a parameter named I_MCR_ID which
h is unknown.
Fri Feb 13 15:40:21 :
Fri Feb 13 15:40:21 : USER ERROR: Procedure me_status.get_status was invoked with a parameter named
  I_MCR_ID which is unknown.
    Class: qqdb_UsageException with ReasonCode: DB_ER_PARAMETERERROR
    Error #: [801, 166]
    Detected at: qqdb_OracleData::VendorInitProcedure
    Last TOOL statement: method MemberPOM.GetMemStatusDyn
    Error Time: Fri Feb 13 15:40:21
    Server: @taz2rr, UserName: ecuser
    Database Statement: begin
      me_status.get_status(I_MCR_ID=>:I_MCR_ID);
      end;
    Exception occurred (locally) on partition "MWRouting_cl1_Part3",
      (partitionId = DD242BB0-B4AC-11D7-989B-C2D07EBCAA77:0x10435:0x1, taskId =
      [DD242BB0-B4AC-11D7-989B-C2D07EBCAA77:0x1042b:0x1.53094]) in application
      "MWRouting_cl1", pid 1036484 on node ServerNode in environment frt1ec.
    USER ERROR: Procedure me_status.get_status was invoked with a parameter
      named I_MCR_ID which is unknown.
        Class: qqdb_UsageException with ReasonCode: DB_ER_PARAMETERERROR
        Error #: [801, 166]
        Detected at: qqdb_OracleData::VendorInitProcedure
        Last TOOL statement: method MemberPOM.GetMemberStatus
        Error Time: Fri Feb 13 15:40:21
        Server: @taz2rr, UserName: ecuser
        Database Statement: begin
          me_status.get_status(I_MCR_ID=>:I_MCR_ID);
          end;
        Exception occurred (locally) on partition "MWRouting_cl1_Part3",
          (partitionId = DD242BB0-B4AC-11D7-989B-C2D07EBCAA77:0x10435:0x1,
          taskId = [DD242BB0-B4AC-11D7-989B-C2D07EBCAA77:0x1042b:0x1.53094]) in
          application "MWRouting_cl1", pid 1036484 on node ServerNode in
          environment frt1ec.

Hello Madhu,
     The best to do this is:
l_intmcrid : integer;
l_intmcrid = theMember.CurMCR.MCR_ID;
l_tdCurrentStatus : TextData;
SQL EXECUTE PROCEDURE me_status.get_status(l_intmcrid) ON SESSION self.DefaultDBSession);
If you want to get some kind of information out from the procedure then you will need to make a output variable on the procedure:
SQL EXECUTE PROCEDURE me_status.get_status(l_intmcrid, output l_tdCurrentStatus) ON SESSION self.DefaultDBSession);
This is the only way I know to call Oracle procedure. There are many examples in the CSAPOM project.
ka

Similar Messages

  • How can I call a Report From database function

    Hi all,
    I want to call a Report from a database function. Could you hel
    me???
    Rgds

    Hello there!
    There is a solution for executing an executable like RWRUN60
    from PL/SQL on http://asktom.oracle.com/pls/ask/f?
    p=4950:8:227101::NO::F4950_P8_DISPLAYID,F4950_P8_B:150612348067,Y
    Or you can invoke the CGI from the Reports-Server through
    UTL_HTTP
    Hope this helps
    Dannys

  • Calling java function load and stored in database

    Hi ,
    I try to call a java fonction loaded and published in database (Oracle 8.1.7.4ee). this function call an OS command ... the PL/SQL call is completed but de command set in parameters function is not execute ... next is the code :
    import java.lang.*;
    import java.io.*;
    public class JShell {
    public static void execute (String command) throws IOException {
    try {
    Process child = Runtime.getRuntime().exec(command);
    } catch (IOException e) {
    calling this function with java main is OK
    import java.lang.*;
    import java.io.*;
    public class TestJShell {
    static public void main(String args[]) throws Exception
    JShell.execute(args[0].toString());
    java TestJShell 'cp /test/myfile.txt /test/myfile.sav'
    copy is donethen when the fuction is loaded and published in database
    as
    loadjava -user ../.. JShell.class
    CREATE OR REPLACE PROCEDURE JShell_exe (Commande in VARCHAR2) AS LANGUAGE JAVA NAME 'JShell.execute(java.lang.String)';run is
    CALL ell_exe ('cp /test/myfile.txt /test/myfile.sav');
    call is completed but no copy is doneCan somebody help me ? thanking you in anticipation;

    Firs things first:
    1)Which copy of your class is loaded in the DB ( it seems that you have two different classes JShell and TestJShell ).
    2)Do you have permisions for file manipulation ?
    3)Do you get any errors ?

  • Calling java function load an store in database

    Hi ,
    I try to call a java fonction loaded and published in database (Oracle 8.1.7.4ee). this function call an OS command ... the PL/SQL call is completed but de command set in parameters function is not execute ... next is the code :
    import java.lang.*;
    import java.io.*;
    public class JShell {
    public static void execute (String command) throws IOException {
    try {
    Process child = Runtime.getRuntime().exec(command);
    } catch (IOException e) {
    calling this function with java main is OK
    import java.lang.*;
    import java.io.*;
    public class TestJShell {
    static public void main(String args[]) throws Exception
    JShell.execute(args[0].toString());
    java TestJShell 'cp /test/myfile.txt /test/myfile.sav'
    copy is donethen when the fuction is loaded and published in database
    as
    loadjava -user ../.. JShell.class
    CREATE OR REPLACE PROCEDURE JShell_exe (Commande in VARCHAR2) AS LANGUAGE JAVA NAME 'JShell.execute(java.lang.String)';run is
    CALL ell_exe ('cp /test/myfile.txt /test/myfile.sav');
    call is completed but no copy is donethank's for your help

    you might need some more privileges to interact with the system from inside oracle.
    I don't know what those are but I had to give privs to a user to open a socket from java.
    exec dbms_java.grant_permission( 'MIS_ADMIN', 'SYS:java.net.SocketPermission', 'localhost', 'resolve' ) ;
    This allowed the jsp to use localhost. You might need to find a similar permission to grant.

  • Calling database stored  function from Entity Object

    Hi,
    I want to call a database stored function from create() method of Entity Object.
    Database function returns some value.
    Can anybody suggest me some way to do it.

    You can try the following:
    make a String whit your function call, I dont know if this is the correct SQL syntax for a function, it should be for a stored procedure.
    String call = "begin; callyourfunction; end;"
    PreparedStatement ps = getDBTransaction().createPreparedStatement(call,0);
    ps.execute();
    ResultSet rs = ps.getResultSet();
    You can now read the data from the function from the rowset.
    Be sure to cleanup the PreparedStatement when your done whit it to avoid open database connections.
    ps.close();ps=null;

  • Calling Remote Functions Locally Triggers any Database commit(Implicit)

    Hello,
    Am making use of RFC enabled function module as normal function module (Calling remote function module locally).
    My question is does it trigger any implicit database commit or not. Since synchronous RFC triggers database commit.
    Regards,
    Tenzin Choegyen

    I057200 wrote:
    Since synchronous RFC triggers database commit.
    Let me correct the statement both synchronous as well as asynchronous RFCs trigger an implicit DB commit.
    SAP documentation on synch-RFCs states:
    If the content of dest is equal to the constant space, then the addition DESTINATION is ignored and a normal call CALL FUNCTION func is executed.
    Please note that you should not use the DESTINATION addition or use DESTINATION space. DESTINATION none will start the FM as an RFC in the same app server.

  • ODI Error - Calling a function in the source database

    I am using this directly in the Interface mapping and getting the following error
    This is the syntax I am using SUM(CASE WHEN ((main.getCertDate(person_id,getdate()) >= current_timestamp) THEN 1 ELSE 0 END)
    ODI-1228: Task Load_Fact_Table1 (Integration) fails on the target MICROSOFT_SQL_SERVER connection SQLSERVER_USA.
    Caused By: java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver][SQLServer]Cannot find either column "main" or the user-defined function or aggregate "main.dbo.getCertDate", or the name is ambiguous.
    Am I missing any additional steps, before calling a function in the mapping. Do I have to do something in the model to include teh function etc., Please help in fixing this issue.
    Thanks for your time and help.

    Hi Michael, Please see below.
    IKM - MSSQL Incremental Update
    Failing on Step 3 - Integration - Insert flow into I$ table
    insert into db11.dbo.##I$_FCT_TABLE
    COMP_ID,
    CNT_CLP_TARGET_MET,
    CNT_CERTIFIED,
    CNT_NOTCERT_WITHIN_GRACE_PRD,
    CNT_CERT_OR_WITHIN_GRACE_PRD,
    CNT_CERT_DELINQUENT,
    SUM_OF_AGE,
    SUM_OF_YEARS_EXPERIENCE,
    LOAD_DATE,
    IND_UPDATE
    select
    CASE WHEN DIM_COMP.COMP_ID IS null then -9999
    ELSE DIM_COMP.COMP_ID
    END,
    SUM(CASE WHEN ((main.dbo.getCertDate ([DISTINCT_RWF.MASTERKEY],GETDATE()) >= CURRENT_TIMESTAMP) OR DISTINCT_RWF = 'NO') THEN 1 ELSE 0 END),
    CURRENT_TIMESTAMP,
    'I' IND_UPDATE
    from ((
    select DISTINCT
    REPORT_WORKFORCE_REVIEW.REGION as REGION, REPORT_WORKFORCE_REVIEW.COMPO as COMPO, REPORT_WORKFORCE_REVIEW.PERSON_ID as PERSON_ID, REPORT_WORKFORCE_REVIEW.WF_STATUS as WF_STATUS, REPORT_WORKFORCE_REVIEW.PERSON_NAME as PERSON_NAME, REPORT_WORKFORCE_REVIEW.CPCN_NUM as CPCN_NUM, REPORT_WORKFORCE_REVIEW.COMMAND as COMMAND, REPORT_WORKFORCE_REVIEW.UIC as UIC, REPORT_WORKFORCE_REVIEW.UIC_STATE as UIC_STATE, REPORT_WORKFORCE_REVIEW.ORG_STRUCTURE_CODE as ORG_STRUCTURE_CODE, REPORT_WORKFORCE_REVIEW.ORG_DESC as ORG_DESC, REPORT_WORKFORCE_REVIEW.LOCATION as LOCATION, REPORT_WORKFORCE_REVIEW.STATE as STATE, REPORT_WORKFORCE_REVIEW.SVC_COMP_DATE as SVC_COMP_DATE, REPORT_WORKFORCE_REVIEW.YRS_OF_SERVICE as YRS_OF_SERVICE, REPORT_WORKFORCE_REVIEW.POSITION_ENTER_DATE as POSITION_ENTER_DATE, REPORT_WORKFORCE_REVIEW.MTHS_EXP_IN_PRESENT_POS as MTHS_EXP_IN_PRESENT_POS, REPORT_WORKFORCE_REVIEW.MTHS_EXP_IN_CURRENT_APC_ACL as MTHS_EXP_IN_CURRENT_APC_ACL, REPORT_WORKFORCE_REVIEW.AGE as AGE, REPORT_WORKFORCE_REVIEW.SEX as SEX, REPORT_WORKFORCE_REVIEW.SUPV_CODE as SUPV_CODE, REPORT_WORKFORCE_REVIEW.ACF as ACF, REPORT_WORKFORCE_REVIEW.CP as CP, REPORT_WORKFORCE_REVIEW.SERIES as SERIES, REPORT_WORKFORCE_REVIEW.DUTY_TITLE as DUTY_TITLE, REPORT_WORKFORCE_REVIEW.APT as APT, REPORT_WORKFORCE_REVIEW.APT_DESC as APT_DESC, REPORT_WORKFORCE_REVIEW.API as API, REPORT_WORKFORCE_REVIEW.SAA as SAA, REPORT_WORKFORCE_REVIEW.GRADE as GRADE, REPORT_WORKFORCE_REVIEW.HI_DEGREE as HI_DEGREE, REPORT_WORKFORCE_REVIEW.LVL_DESC as LVL_DESC, REPORT_WORKFORCE_REVIEW.APC as APC, REPORT_WORKFORCE_REVIEW.ACL as ACL, REPORT_WORKFORCE_REVIEW.CERT_LVL_ACHIEVED_IN_APC as CERT_LVL_ACHIEVED_IN_APC, REPORT_WORKFORCE_REVIEW.CERT_IN_POSITION as CERT_IN_POSITION, REPORT_WORKFORCE_REVIEW.CERT_BELOW_POSITION as CERT_BELOW_POSITION, REPORT_WORKFORCE_REVIEW.NOT_CERTIFIED as NOT_CERTIFIED, REPORT_WORKFORCE_REVIEW.CLP as CLP, REPORT_WORKFORCE_REVIEW.LAST_IDP_UPDATE as LAST_IDP_UPDATE, REPORT_WORKFORCE_REVIEW.LAST_IDP_UPDATE_MTHS as LAST_IDP_UPDATE_MTHS, REPORT_WORKFORCE_REVIEW.SUPV_REVIEW_DATE as SUPV_REVIEW_DATE, REPORT_WORKFORCE_REVIEW.SUPV_REVIEW_DATE_MTHS as SUPV_REVIEW_DATE_MTHS, REPORT_WORKFORCE_REVIEW.EMAIL as EMAIL, REPORT_WORKFORCE_REVIEW.MASTERKEY as MASTERKEY
    from main.dbo.REPORT_WORKFORCE_REVIEW as REPORT_WORKFORCE_REVIEW
    where (1=1)
    ) as DISTINCT_REPORT_WORKFORCE_REVIEW LEFT JOIN main.dbo.PERSON as PERSON ON DISTINCT_REPORT_WORKFORCE_REVIEW.MASTERKEY=PERSON.MASTERKEY) LEFT JOIN main.dbo.ACQUISITION_CORPS_QUALIFICATION as ACQUISITION_CORPS_QUALIFICATION ON DISTINCT_REPORT_WORKFORCE_REVIEW.MASTERKEY=ACQUISITION_CORPS_QUALIFICATION.MASTERKEY) LEFT JOIN main.dbo.PERSONS_POSITIONS as PERSONS_POSITIONS ON DISTINCT_REPORT_WORKFORCE_REVIEW.PERSON_ID=PERSONS_POSITIONS.MASTERKEY
    AND PERSONS_POSITIONS.POSITION_END_DATE IS NULL) INNER JOIN db11.dbo.DIM_COMP as DIM_COMP ON DISTINCT_REPORT_WORKFORCE_REVIEW.COMPO=DIM_COMP.COMP_CODE AND DIM_COMP.CURRENT_RECORD_IND = 1) LEFT JOIN db11.dbo.DIM_POSITION_TYPE as DIM_POSITION_TYPE ON DISTINCT_REPORT_WORKFORCE_REVIEW.APT=DIM_POSITION_TYPE.POSITION_CODE
    AND DIM_POSITION_TYPE.CURRENT_RECORD_IND=1)

  • HTTPService: How can I send a variable or call a function in it?

    Ok i have the following HTTPService request:
    <mx:HTTPService id="userRequest" url="
    http://mywebsite/get_data.php"
    useProxy="false" method="POST">
    <mx:request xmlns="">
    <user1>{username.text}</user1>
    </mx:request>
    </mx:HTTPService>
    Pretty straight forward stuff there. EXCEPT... i want to use
    a variable instead of 'username.text...
    <user1>{UserNameList[0]}</user1>
    OR i want to be able to call a function that will return the
    results such as:
    <user2>{ UserFunction() }</user2>
    Of course, neither of these work and this makes me sad :(
    Anyone have any ideas? Much appreciated~!

    on that i can't help
    i'm a .net programmer an i use a lot httpservices but mostly
    i use webservices to get my data.
    But i can give my way of working. When you send your data
    from flex you are sending a virtual xml file thru http, then in
    .net using it xml class i read this stream of xml coming from flex,
    go to my database, get the result , wrapped it in xml and send thru
    stream again, so that flex understands the answer. When it gets to
    flex i just use e4x to read my data.
    There are tons of tutorials on the net for PHP, i wish i had
    half for .Net :D

  • ERROR:When calling  a Function

    Hi all,
    i am trying to call a function from AM.and when i run the page i got this error. anbody please help me guys.
    its very urgent.
    oracle.apps.fnd.framework.OAException: Application: FND, Message Name: SQL_PLSQL_ERROR. Tokens: ROUTINE = AppsConnectionManager.appsInitialize(int,int,int,int,Connection):-1,-1,-1,0,oracle.jdbc.driver.OracleConnection@f7a4ba; REASON = java.sql.SQLException: No more data to read from socket; ERRNO = 17410; (Could not lookup message because there is no database connection)
         at oracle.apps.fnd.framework.server.OAExceptionUtils.processAOLJErrorStack(OAExceptionUtils.java:988)
         at oracle.apps.fnd.framework.OACommonUtils.processAOLJErrorStack(OACommonUtils.java:866)
         at oracle.apps.fnd.framework.CreateIcxSession.getEncryptedSessId(CreateIcxSession.java:219)
         at oracle.apps.fnd.framework.CreateIcxSession.createSession(CreateIcxSession.java:80)
         at runregion.jspService(runregion.jsp:96)
         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 ##
    oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_GENERIC_MESSAGE. Tokens: MESSAGE = java.sql.SQLException: No more data to read from socket; (Could not lookup message because there is no database connection)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
         at oracle.apps.fnd.framework.server.OAExceptionUtils.processAOLJErrorStack(OAExceptionUtils.java:980)
         at oracle.apps.fnd.framework.OACommonUtils.processAOLJErrorStack(OACommonUtils.java:866)
         at oracle.apps.fnd.framework.CreateIcxSession.getEncryptedSessId(CreateIcxSession.java:219)
         at oracle.apps.fnd.framework.CreateIcxSession.createSession(CreateIcxSession.java:80)
         at runregion.jspService(runregion.jsp:96)
         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: No more data to read from socket
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
         at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:963)
         at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
         at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:105)
         at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:611)
         at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:576)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2809)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:622)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:698)
         at oracle.apps.fnd.security.AppsConnectionManager.appsInitialize(AppsConnectionManager.java:472)
         at oracle.apps.fnd.security.AppsConnectionManager.borrowConnection(AppsConnectionManager.java:319)
         at oracle.apps.fnd.common.Context.borrowConnection(Context.java:1773)
         at oracle.apps.fnd.common.AppsContext.getPrivateConnectionFinal(AppsContext.java:2460)
         at oracle.apps.fnd.common.AppsContext.getPrivateConnection(AppsContext.java:2398)
         at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:2257)
         at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:2072)
         at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:1976)
         at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:1993)
         at oracle.apps.fnd.common.Context.getJDBCConnection(Context.java:1541)
         at oracle.apps.fnd.framework.CreateIcxSession.getConnection(CreateIcxSession.java:559)
         at oracle.apps.fnd.framework.CreateIcxSession.getIntValue(CreateIcxSession.java:346)
         at oracle.apps.fnd.framework.CreateIcxSession.getUserID(CreateIcxSession.java:323)
         at oracle.apps.fnd.framework.CreateIcxSession.getEncryptedSessId(CreateIcxSession.java:148)
         at oracle.apps.fnd.framework.CreateIcxSession.createSession(CreateIcxSession.java:80)
         at runregion.jspService(runregion.jsp:96)
         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)
    oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_GENERIC_MESSAGE. Tokens: MESSAGE = java.sql.SQLException: No more data to read from socket; (Could not lookup message because there is no database connection)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
         at oracle.apps.fnd.framework.server.OAExceptionUtils.processAOLJErrorStack(OAExceptionUtils.java:980)
         at oracle.apps.fnd.framework.OACommonUtils.processAOLJErrorStack(OACommonUtils.java:866)
         at oracle.apps.fnd.framework.CreateIcxSession.getEncryptedSessId(CreateIcxSession.java:219)
         at oracle.apps.fnd.framework.CreateIcxSession.createSession(CreateIcxSession.java:80)
         at runregion.jspService(runregion.jsp:96)
         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: No more data to read from socket
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
         at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:963)
         at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
         at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:105)
         at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:611)
         at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:576)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2809)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:622)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:698)
         at oracle.apps.fnd.security.AppsConnectionManager.appsInitialize(AppsConnectionManager.java:472)
         at oracle.apps.fnd.security.AppsConnectionManager.borrowConnection(AppsConnectionManager.java:319)
         at oracle.apps.fnd.common.Context.borrowConnection(Context.java:1773)
         at oracle.apps.fnd.common.AppsContext.getPrivateConnectionFinal(AppsContext.java:2460)
         at oracle.apps.fnd.common.AppsContext.getPrivateConnection(AppsContext.java:2398)
         at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:2257)
         at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:2072)
         at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:1976)
         at oracle.apps.fnd.common.AppsContext.getJDBCConnection(AppsContext.java:1993)
         at oracle.apps.fnd.common.Context.getJDBCConnection(Context.java:1541)
         at oracle.apps.fnd.framework.CreateIcxSession.getConnection(CreateIcxSession.java:559)
         at oracle.apps.fnd.framework.CreateIcxSession.getIntValue(CreateIcxSession.java:346)
         at oracle.apps.fnd.framework.CreateIcxSession.getUserID(CreateIcxSession.java:323)
         at oracle.apps.fnd.framework.CreateIcxSession.getEncryptedSessId(CreateIcxSession.java:148)
         at oracle.apps.fnd.framework.CreateIcxSession.createSession(CreateIcxSession.java:80)
         at runregion.jspService(runregion.jsp:96)
         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)

    its very urgent.Oh no! Sorry I couldn't respond sooner - I do hope the patient who was undergoing his critical surgery that obviously was held up because you couldn't call your function has survived!
    Looks like the connection was dropped/terminated. What does your function do? You haven't really given any information whatsoever that would enable someone to help you (such as version, perhaps a code snippet, etc)
    John

  • Invalid column type error while calling db function.

    We are getting an exception while calling the database function which returns a Varray of objects. We are using jpub to generate the wrapper method, ran sqlj to generate the JDBC code. The environment is weblogic 5.1 EJB container with ORacle 8.1.6.0.0 database. The JDBC driver is 8.1.7 thin, sqlj version is 8.1.7. I am giving below the exception.
    When the sqlj option profile=false is not set, the error is Classcast exception. Appraently the weblogic connection object can not be used to do oracle specific calls. If somebody has done similar things(creating a bean which calls the stored function with weblogic which returns the oracle object types) or know what the issue is, please let me know.
    Thanks,
    Vijay.
    stackTrace:
    java.sql.SQLException: Invalid column type
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:43)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:4560)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:225)
    at oracle.jdbc.driver.OracleCallableStatement.registerOutParameter(OracleCallableStatement.java:350)
    at weblogic.jdbcbase.pool.Statement.registerOutParameter(Statement.java:438)
    at sqlj.runtime.profile.ref.RTStatementJDBCCallable.registerOutParameter(RTStatementJDBCCallable.java:135)
    at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.registerParameters(Compiled Code)
    at sqlj.runtime.profile.ref.ParamRegProfile$ParamRegCachedStatement.getStatement(ParamRegProfile.java:101)
    at sqlj.runtime.profile.ref.CachedStatementProfileWrapper.getStatement(CachedStatementProfileWrapper.java:134)
    at sqlj.runtime.ExecutionContext$StatementStack.setStatement(ExecutionContext.java:995)
    at sqlj.runtime.ExecutionContext.registerStatement(ExecutionContext.java:523)
    at com.xpede.calculator.processor.jdbc.NewPrdGroupPkg.maincalculator(NewPrdGroupPkg.java:341)
    ----------------------

    Weblogic essentially wrappers the Oracle JDBC driver - as you can see from the stack trace, it does not just wrapper the connection object, but also the statement object.
    The SQLJ runtime does not recognize the JDBC layer anymore as an Oracle JDBC driver.
    What is happening at runtime may be the following:
    (1) The invalid column type likely results from SQLJ attempting to register the type as Types.OTHER (code 1111). This typecode is not supported by Oracle JDBC.
    (2) The class cast exception when using Oracle objects may result from a getObject() call which returns the value in default format (such as oracle.sql.ARRAY) rather than the JPublisher-generated wrapper object.
    Are you using JDK 1.2 / runtime12.zip?
    In that case you can try the standard (java.sql.)SQLData interface (in JPub: -usertypes=jdbc). However, this interface will not support wrappers for VARRAYs.

  • Return value from database function taking a lot more time than the query

    Hi guys,
    I have a Query that does a call to a database function. The function takes in a few parameters and returns a Date. Now, the query within the function takes barely .05 seconds. However, doing a select get_join_dates from dual is taking almost 6 seconds for each call.
    Here is the Query:
    select s.student_id, s.student_name, s.organization_code
    from   student s
    where  s.student_id = :p_student_id
    and    s.student_enrollment_date = get_join_dates( :p_year,
                                                       :p_month,
                                                       :p_student_id,
                                                       s.organization_code );And here is the database function. The select inside this function barely takes 0.05 seconds per call. This function gets called 3 times in my case as there are 3 records in the org_body table for this student.
    create or replace function
    get_join_dates( p_yyyy in org_body.fiscal_yyyy%type,
                           p_month in  org_body.fiscal_mm%type,
                           p_student_id in student.student_id%type,
                           p_organization_code in org_body.organization_code%type) return date as
        t_enrollment_date  date;
        cursor cur_latest_enrollment_date is
          select max(enrollment_date)
          from   org_body
          where  fiscal_yyyy = p_yyyy
          and    fiscal_mm = p_month
          and    student_id = p_student_id
          and    organization_code = p_organization_code;
      BEGIN
        open cur_latest_enrollment_date ;
        fetch cur_latest_enrollment_date into t_enrollment_date;
        close cur_latest_enrollment_date ;
        return t_enrollment_date;
      exception
        when others then
          null;
    end;owever, when I run the following statement below, it takes close to 6 seconds to retrieve a record. In turn, my Query is becoming really slow and taking almost 35 seconds. Imagine that with more records.
    select get_join_dates( 2010, '01', '2167543', 'PSYCH01' ) from dual;If I run my query with this condition below, it takes 0.5 seconds.
    select s.student_id, s.student_name, s.organization_code
    from   student s
    where  s.student_id = :p_student_id
    and      s.student_enrollment_date = '01-JAN-10'Any ideas would be greatly appreciated.

    Any reason why you are doing this with the stored function?
    You could just do this with SQL. Embed the query in the function as a subquery in your initial query from STUDENT.
    select s.student_id, s.student_name, s.organization_code
    from   student s
    where  s.student_id = :p_student_id
    and    s.student_enrollment_date =
    (select max(enrollment_date)
          from   org_body
          where  fiscal_yyyy = :p_year
          and    fiscal_mm = :p_month
          and    student_id = s.student_id
          and    organization_code = s.organization_code);Why your function is not performing: I cannot say that with the information you have provided.
    Maybe sqltrace a call and see what the reason is.

  • How to Oracle Database Function in OBIEE Administration Tool

    Hi All,
    I want to use a Oracle Database Function in as a column in OBIEE (BM, Presentation Model). Can anybody has done this inOBIEE. Any pointers to this is much appreicated.
    Thanks,

    Hi user7417334,
    You cannot use any formulas in the presentation layer (not that I know of). But you can definitely use oracle database functions in the BMM layer.
    You want to use the EVALUATE function. It works like this:
    e.x. EVALUATE( 'TO_DATE(%1,%2)' AS DATE, '12/31/2009', 'MM/DD/YYYY')
    Generic Version: EVALUATE( '<FUNC>' AS <DATATYPE>, VALUE1,VALUE2,etc)
    FUNC) Is the syntax for the function you are calling. Any parameters have to be replaced by %<number>, where number refers to the order in which you specify your parameters.
    DATATYPE) The datatype that the function will evaluate to. In this case, DATE.
    VALUE1) The latter part of the formula is a comma separated list of all the parameters used in the function. In this case, it's the date I want to cast
    VALUE2) This is the second parameter. You need as many as you referenced in your function. In this case, it's the date format.
    Good luck and if you found this post useful, please award points!
    best regards,
    -Joe

  • Calling oracle function in OMB script

    Hi
    Can anyone please tell me how can i get the returned value of an oracle function in OMB script. or how can i get the value into OMB variable and use it.
    Basically i want to set the properties of OWB mapping via OMB script.
    Following OMB code sets the max error limit of a mapping.
    OMBALTER MAPPING 'MAP_DATA' SET PROPERTIES (MAXIMUM_NUMBER_OF_ERRORS) VALUES ('100')
    i dont want to hard code the value 100 rather i want this value to be returned from a function.
    If it is not possible then plz tell me how can i set MAXIMUM_NUMBER_OF_ERRORS property of OWB mapping via sql or pl/sql.
    Any type of clue will be highly appreciated.
    Best Regards

    Here is my bare-bones OMB SQL Library to allow you to do pure SQL calls from within OMB+. All I have ever used it for is to run queries, so I don't have a library procedure for calling a function, however if your function is SQL-callable (e.g. select my_func() from dual) then it would work. Either that or you'll want to augment this library to build a procedure that will call and return the results from a java preparedStatement. It's something I've been meaning to do, but haven't got around to it yet.
    All you should need to do is save this as it's own tcl file and then source it at the top of your own script, or embed it into your script.
    EDIT: Here is a page with some sample code on using java.sql.CallableStatement to call a Pl/SQL procedure from Java which should certainly do the trick for you in conjunction with the basic session control in my library.
    http://www.exampledepot.com/egs/java.sql/CallProcedure.html
    Cheers,
    Mike
    package require java
    #file omb_sql_library.tcl
    proc oracleConnect { serverName databaseName portNumber username password } {
       # import required classes
       java::import java.sql.Connection
       java::import java.sql.DriverManager
       java::import java.sql.ResultSet
       java::import java.sql.SQLWarning
       java::import java.sql.Statement
       java::import java.sql.CallableStatement
       java::import java.sql.ResultSetMetaData
       java::import java.sql.DatabaseMetaData
       java::import java.sql.Types
       java::import oracle.jdbc.OracleDatabaseMetaData
       # load database driver .
       java::call Class forName oracle.jdbc.OracleDriver
       # set the connection url.
       append url jdbc:oracle:thin
       append url :
       append url $username
       append url /
       append url $password
       append url "@"
       append url $serverName
       append url :
       append url $portNumber
       append url :
       append url $databaseName
       set oraConnection [ java::call DriverManager getConnection $url ]
       set oraDatabaseMetaData [ $oraConnection getMetaData ]
       set oraDatabaseVersion [ $oraDatabaseMetaData getDatabaseProductVersion ]
       puts "Connected to: $url"
       puts "$oraDatabaseVersion"
       return $oraConnection
    proc oracleDisconnect { oraConnect } {
      $oraConnect close
    proc oraJDBCType { oraType } {
      #translation of JDBC types as defined in XOPEN interface
      set rv "NUMBER"
      switch $oraType {
         "0" {set rv "NULL"}
         "1" {set rv "CHAR"}
         "2" {set rv "NUMBER"}
         "3" {set rv "DECIMAL"}
         "4" {set rv "INTEGER"}
         "5" {set rv "SMALLINT"}
         "6" {set rv "FLOAT"}
         "7" {set rv "REAL"}
         "8" {set rv "DOUBLE"}
         "12" {set rv "VARCHAR"}
         "16" {set rv "BOOLEAN"}
         "91" {set rv "DATE"}
         "92" {set rv "TIME"}
         "93" {set rv "TIMESTAMP"}
         default {set rv "OBJECT"}
      return $rv
    proc oracleQuery { oraConnect oraQuery } {
       set oraStatement [ $oraConnect createStatement ]
       set oraResults [ $oraStatement executeQuery $oraQuery ]
       # The following metadata dump is not required, but will be a helpfull sort of thing
       # if ever want to really build an abstraction layer
       set oraResultsMetaData [ $oraResults getMetaData ]
       set columnCount        [ $oraResultsMetaData getColumnCount ]
       set i 1
       #puts "ResultSet Metadata:"
       while { $i <= $columnCount} {
          set fname [ $oraResultsMetaData getColumnName $i]
          set ftype [oraJDBCType [ $oraResultsMetaData getColumnType $i]]
          #puts "Output Field $i Name: $fname Type: $ftype"
          incr i
       # end of metadata dump
       return $oraResults
    # SAMPLE CODE to run a quick query and dump the results. #
    #set oraConn [ oracleConnect myserver orcl 1555 scott tiger ]
    #set oraRs [ oracleQuery $oraConn "select name, count(*) numlines from user_source group by name" ]
    #for each row in the result set
    #while {[$oraRs next]} {
      #grab the field values
    #  set procName [$oraRs getString name]
    #  set procCount [$oraRs getInt numlines]
    #  puts "Program unit $procName comprises $procCount lines"
    #$oraRs close
    #oracleDisconnect $oraConnEdited by: zeppo on Nov 25, 2008 7:19 AM

  • Calling JS function in pl/sql process

    Hello!
    I have a js function defined in 'HTML Header' :
    <script language="JavaScript" type="text/javascript">
    function disp_alert()
    alert("Data is invalid! Correct the data and click CONFIRM again.")
    </script>
    I also have a pl/sql process on this page. I want to call disp_alert function in a following way:
    if ... then call function
    else dbms_output.put_line('...');
    end if;
    How can I call this js function in 'if'??
    Tom

    There ARE ways to accomplish something like this, but they're much more complex.
    You must create a JavaScript that uses APEX's built in AJAX components; a form button will call the JavaScript, which will in turn call a PL/SQL procedure saved as an "On Demance Shared Application Process." This procedure can run any checks you like against the DB, and return data to the Javascript to display in an alert.
    You can see an example of this in use at an APEX page I created: http://htmldb.oracle.com/pls/otn/f?p=19864:5
    This isn't the same thing, but is accomplishing what it does through an APEX form, a javascript call on the text field to a PL/SQL Process that returns rows from the database dynamically...thus allowing the client side JavaScript to call server side PL/SQL.

  • Calling ODI Function

    Hi All,
    I need to add the value of 2 source fields ( Source is a file) and based upon that I need to populate the target column value ( target is DB table). For this I have written a PL/SQL function which I am calling in ODI user function , and the desired result is achieved.
    But the thing is , I need to implement this small functionality in ODI itself and not using PL/SQL database functions. The logic can be written in ODI function also but when we call ODI function in mapping it takes the complete logic in the select statement itself. Please let me know where can I write this in ODI to achieve the same.
    Thanks in Advance,
    Regards
    Abhishek Sharma

    OK, so what is wrong with it? That is the functionality of the ODI function, it is a place holder so that you do not have to type same long SQL again and again.

Maybe you are looking for

  • IPhone 4 battery drains really fast and phone gets really hot

    I have an iPhone 4 and since November 15 my battery has been draining really fast and gets really hot when I use the phone. When I try to charge the phone with my computer it doesn't charge, but only charges with the wall hub. I have tried deleting t

  • I have a hp f380 all in one printer all 3 lights are blinking

    I followed all the instructions on hp.com nothing has worked. I just bought new cartridges for the printer it has aligned 3 times already but won't copy or scan because the ink cartridge light, paper jam and power lights are all blinking at the same

  • Difference between exists and createIf

    Hi all, In Node functions we are having createIf and exists. what is the difference between createIf and exists? Where we have to use createIf and where we have to use exists? Thanks Sridhar

  • OA frame works

    Hi , can any one please tell me where I am going to find the OA framework Study material ( in which site). Thank u.

  • Where are the ID and Password fields in End User Login ?

    Hi: I need to modifiy the ID / Password labels of the end-user login. I searched it in the WPMessages.properties, but i only find the variable UI_PWD_LABEL, and if i change it, it saw in the Admin Login but not in the User Login. Any idea? Thanks, MJ