EJB 3.0 Persistence API and Stored Procedures

Does the EJB 3.0 Persistence API in any way prescribe or facilitate the use of Stored Procedure calls? Given the recent popularity of using (database) server APIs consisting of Stored Procedures that are addressed by ORM frameworks for performing the DML operations and of course the general usefulness of stored procedures for specific data related operations, there definitely is a need for clarity on using the straightforward Persistence operations in combination with calls to Stored Procedures. Can we use the Native Query for executing CallableStatements? Can we get to a Connection instance from the EntityManager? Can we easily use the results from a Stored Procedure invocation to refresh our Domain Objects - or is that all application logic in which the EntityManager cannot help us?
If the spec does not help us at this point, do you know how TopLink will deal with this topic?
Thanks for any help you can give me!
Best regards,
Lucas Jellema

I'm am also interested in a response to this post. I've just upgraded to JDeveloper 10.1.3.1 and am interested in making calls to stored procedures.
I've found examples of just creating my own session beans but it seems I would have to hard code the datasource name. Does anyone know if I can get around this using the entity manager supplied by the tool?
thanks,
Dan

Similar Messages

  • DAC task with Informatica mapping and stored procedure (very slow)

    Hello,
    We have a DAC task that launch an Informatica Workflow with a simple query and stored procedure, like this:
    SQL QUERY
    ==========================
    SELECT
    W_ACTIVITY_F.ROW_WID,
    W_AGREE_D.AGREE_NUM,
    W_PRODUCT_D.ATTRIB_51,
    W_SRVREQ_D.ATTRIB_05,
    W_ORG_DH.TOP_LVL_NAME,
    W_ORG_D.ATTRIB_06,
    W_PRODUCT_GROUPS_D.PRODUCT_LINE,
    W_PRODUCT_D.PROD_NAME
    FROM
    W_AGREE_D,
    W_SRVREQ_F,
    W_ACTIVITY_F,
    W_PRODUCT_D LEFT OUTER JOIN W_PRODUCT_GROUPS_D ON W_PRODUCT_D.PR_PROD_LN = W_PRODUCT_GROUPS_D.PRODUCT_LINE,
    W_ORG_D,
    W_SRVREQ_D,
    W_ORG_DH
    WHERE
    W_SRVREQ_F.AGREEMENT_WID = W_AGREE_D.ROW_WID AND
    W_SRVREQ_F.SR_WID = W_ACTIVITY_F.SR_WID AND
    W_SRVREQ_F.PROD_WID = W_PRODUCT_D.ROW_WID AND
    W_SRVREQ_F.ACCNT_WID = W_ORG_D.ROW_WID AND
    W_SRVREQ_F.SR_WID = W_SRVREQ_D.ROW_WID AND
    W_ORG_D.ROW_WID = W_ORG_DH.ROW_WID
    STORED PROCEDURE
    ===========================
    ConvSubProy(W_AGREE_D.AGREE_NUM,
    W_PRODUCT_D.ATTRIB_51,
    W_SRVREQ_D.ATTRIB_05,
    W_ORG_DH.TOP_LVL_NAME,
    W_ORG_D.ATTRIB_06,
    W_PRODUCT_GROUPS_D.PRODUCT_LINE,
    W_PRODUCT_D.PROD_NAME)
    The mapping is very simple:
    Source Qualifier -> Stored procedure -> Update strategy (only two ports: ROW_WID and custom column) -> Target Table
    When I launch the DAC Execution Plan the corresponding task take much time (40 minuts). But when I launch the corresponding Workflow from Informatica PowerCenter Workflow Manager this only take 50 seconds... when I see the log session for the task I can see that much time is spent on the time of the updates. For example, when DAC is running the writer updates 10000 records every 6/7 minuts, but when Workflow Manager is running thw writer updates 10000 records every 8/9 seconds.
    So, what happens (in the DAC) to that so much time difference? Is there a way to reduce the execution time when the task is launched from DAC?
    Thanks
    Best Regards
    Benjamin Tey

    Have you tried using bulk load type?
    In Workflow Manager can you open the associated task, navigate to the mapping tab and seled the target table.
    What is the value for "Target load type" and which of the following boxes are checked: Insert, Update as Update, Update as Insert, Update else Insert, Delete?

  • Database updation using XML and stored Procedure?

    Hello,
    I want to perform updation in multiple tables using XML files.Please suggest can I do updation using xml and stored procedure.
    If yes then which is more efficient and takes less time.
    1.Updation using xml files only
    2.Updation using xml files with stored procedure.
    3.Stored procedure alone.
    If direct xml and stored procedure communication is possible.then please write how.
    Thanks in advance for any help.

    Here's a sample. The next code drop of the XSQL Servlet will make the easy-to-do from within XSQL Pages:
    package package1;
    import org.w3c.dom.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.xml.sql.query.OracleXMLQuery;
    public class Class1 extends Object {
    public static void main( String[] arg ) throws Exception {
    Connection conn = getConnection();
    CallableStatement ocs = conn.prepareCall("begin ? := App.HotItems('PAUL'); end;");
    ocs.registerOutParameter(1,OracleTypes.CURSOR);
    ocs.execute();
    ResultSet rs = ((OracleCallableStatement)ocs).getCursor(1);
    OracleXMLQuery oxq = new OracleXMLQuery(conn,rs);
    System.out.println(oxq.getXMLString());
    oxq.close();
    rs.close();
    ocs.close();
    conn.close();
    public static Connection getConnection() throws Exception {
    String username = "scott";
    String password = "tiger";
    String dburl = "jdbc:oracle:thin:@localhost:1521:xml";
    String driverClass = "oracle.jdbc.driver.OracleDriver";
    Driver d = (Driver)Class.forName(driverClass).newInstance();
    return DriverManager.getConnection(dburl,username,password);
    null

  • How to call EJB deployed on OC4J from java stored procedure?

    Hello,
    I'd like to call EJB from java stored procedure. My example works fine from command line, but the problem seems to be with deployment of this code into database. Especialy I'm wondering how to reference jars like oc4jclient.jar, ejb.jar, ... from java stored procedure.
    Is there some example how to do that ?
    Can You help me please ?
    Many thanks,
    Radim Kolek,
    Eurotel Prague.

    Hi,
    You may want to check up this thread
    Calling JBoss EJBs from Java stored procedure
    Hope this helps,
    Sujatha.
    OTN Group.

  • Approval Procedures and Stored Procedures

    Hi All
    I have a problem with approval procedures and stored procedures.
    I created an approval procedure to check if a value in the udf is selected or not . if not then a messge is produced to ask the user to select the person to approve the PO.
    Biut now the problem is the PO's are linked approval templates to the error messge don't show before the approval template screen.
    Please assist.
    Thanks
    Bongani Dlamini

    Hi Gordon
    The stored procedure is just for validating if the user has selected the udf value.
    It is not for approval*
    I created an approval template for this purpose. So my problem is when I add the Po to the system the SP doesn't kick-in and alert the user to select the person to approve the PO.
    Process Flow.
    User captures PO then select the value on the UDF Field ( Approver) The value selected is linked to a query which is used by the Approval Template
    If this method is still not supported then please let me know .
    Thanks
    Bongani Dlamini

  • EJBs and Stored Procedures

    Hello!
    I want to bind an EJB (probably an BMP entity bean) to the result of a stored procedure.
    Can this be done? Are there any examples? thx

    You would be after the JDBC CallableStatement interface which is part of JDBC 2.0
    Most of the EJB books have a chapter on JDBC which will include it, there are probably examples on the web but I'm afraid I don't know where to find them.

  • JDO transaction, caching and stored procedures

    I currently retreive an existing object, update the object, and then call
    a stored procedure - all in one transaction. The issue I am running into
    is that the stored proc must have the modified data available when it
    selects the row (modified object) from the table. This is currently not
    happening. For example, if the initial field was null, then it is updated
    and the proc called, the proc only sees null. How do I specify that the
    changes should be processed w/in the transaction (not commited) and
    available for other processes reading the data in the same tx?
    Note: everything works perfect if I manually execute the update statement
    through a Statement on the connection for the stored proc. I have tried
    flush().
    Any ideas would be greatly appreciated!

    Here is a dumbed down version... I also tried doing a Query with JDO and
    that returns the modified value. Basically, the code below find the
    existing object, modifies a field, and then calls a stored proc to do some
    processing. Unfortunately, the stored proc needs to be able to "see" the
    modified data in the transaction.
    public void modifyFoo( UserToken userToken,
    Foo newFoo,
    Integer applicationId )
    PersistenceManager pm = null;
    Transaction tx = null;
    Integer applicationId = producerApplication.getId();
    try
    pm = JDOFactory.getPersistenceManager( userToken );
    tx = pm.currentTransaction();
    tx.begin();
    FooBoId appId = new FooBoId();
    appId.fooBolId = applicationId;
    FooBo appDbVo = (FooBo)pm.getObjectById( appId, true );
    appDbVo.setEffectiveDate( newFoo.getEffectiveDate() );
    String fooNumber = executeFooBar( userToken, applicationId
    appDbVo.setFooNumber( fooNumber );
    tx.commit();
    private String executeFooBar( UserToken userToken, Integer
    applicationId )
    throws PulsarSystemException, ValidationException
    String licenseNumber = null;
    try
    // Get a connection from the persistence manager
    Connection connection = JDOFactory.getConnection( userToken );
    connection.setAutoCommit( false );
    CallableStatement cs = connection.prepareCall( "{call
    sys_appl_pkg.fooBar(?,?,?,?,?,?)}" );
    // Register the type of the return value
    cs.registerOutParameter( 4, Types.NUMERIC );
    cs.registerOutParameter( 5, Types.NUMERIC );
    cs.registerOutParameter( 6, Types.VARCHAR );
    // Set parameters:
    cs.setString( 1, "Test" );
    cs.setInt( 2, applicationId.intValue() );
    cs.setInt( 3, 0 );
    catch( SQLException ex )
    ex.printStackTrace();
    return licenseNumber;
    Patrick Linskey wrote:
    Can you post the code that you're executing?
    -Patrick
    On Mon, 14 Jul 2003 20:38:09 +0000, Josh Zook wrote:
    I currently retreive an existing object, update the object, and then call
    a stored procedure - all in one transaction. The issue I am running into
    is that the stored proc must have the modified data available when it
    selects the row (modified object) from the table. This is currently not
    happening. For example, if the initial field was null, then it is updated
    and the proc called, the proc only sees null. How do I specify that the
    changes should be processed w/in the transaction (not commited) and
    available for other processes reading the data in the same tx?
    Note: everything works perfect if I manually execute the update statement
    through a Statement on the connection for the stored proc. I have tried
    flush().
    Any ideas would be greatly appreciated!
    Patrick Linskey
    SolarMetric Inc.

  • Baffled by Toplink and stored procedures

    Here's what I'm after...
    I have a nice package built to act as a bridge to a MySQL database. Everything works fine, but I need to write classes to "wrap" two stored procedures (procedures, not functions or triggers, defined in the database itself). I want to leverage the TopLink connection handling so that I don't have to open/close connections for these two classes. Surely there is some way to do this.
    Working with one example...
    Stored Procedure definition:
    CREATE PROCEDURE openPorts (ipAddr INT UNSIGNED)
    BEGIN
      DECLARE lastScanID INT UNSIGNED;
      SELECT results.scanrequestid INTO lastScanID
        FROM (results,network,scanner)
        WHERE
          results.ip=ipAddr and
          results.ip between network.ip and network.ip+pow(2,(32-network.cidr))-1 and
          results.scannerip=scanner.ip and
          scanner.regionid=network.regionid
        ORDER BY results.endtime DESC LIMIT 1;
      SELECT distinct protocol,port
        FROM results
        where
          ip=ipAddr and
          scanrequestid=lastScanID and
          port>0 and protocol>0
        ORDER BY PROTOCOL,PORT;
    ENDI want to create a class file OpenPortsDAO such that calling
    List<OpenPort> ports = OpenPortsDAO.find(int ipInteger)Yields a list (or vector, whatever) of the rows returned as the result.
    Ignoring for the moment the issues with mapping returned row fields to object fields in my OpenPort class, how the heck do I...
    1) Define the stored procedure
    2) Set the input variable value
    3) Get the connection (if necessary)
    4) Execute the query
    I imagine it's going to be something like...
    StoredProcedureCall call = new StoredProcedureCall();
    call.setProcedureName("hostSummary");
    call.addNamedArgumentValue("ipAddr", value);
    call.getResult();Should this wrapping class be defined in the persistence unit just like any other? If so, my assumption is then that I would not have to manually handle connections, etc.
    Any help would be very much appreciated. I think if I can just get pointed in the right direction, it should "click" for me.
    -David

    Doug,
    Thanks for the info. I was able to handle the stored procedure, but I did so via POJOs.
    I'm interested in this part of your reply...
    >
    This will give you an entity class with a full lifecycle to it assuming that TopLink may write it back to the database if modified in a transaction.
    Given the following pseudo-&lt;code|SQL>...
    drop table starship
    go
    drop table contractor
    go
    create table contractor (
    id serial primary key,
    name text unique)
    go
    create table starship (
    id serial primary key,
    name text unique,
    contractor_id int references contractor)
    go
    create function get_by_id(shipid int, OUT contractor, OUT shipname)
    BEGIN
      blah
    END;
    GOAre you saying that I can create a full CRUD object for the function/procedure call? IE., assuming I get back a result and I see that the ship name is incorrect, I could make a change to the returned data and have that persisted? Without having to get a starship object on my own?
    If that's the case, I'd like to know more.
    -David

  • TopLink and Stored Procedures

    Hi all
    We are migrating an application made with MS ASP's to a full blown J2EE application using ADF, JSF and toplink, atm we've used the mapping abilities from toplink and have saved lots of work, however i'd like to know if there's aw ay to map the Stored procedures the same way you map the tables. This would be a great time saving routine, if not available we might have to write it but I thought we would ask here first. Any pointers?
    greetings!

    TopLink does fully support invoking stored procedures for any query. It is not available in the graphical mapping editors but is available through the API. Look in the documentation for StoredProcedureCall.
    Doug

  • SQL Server 2008 R2 - Report Builder 3.0 - timeout using shared data source and stored procedure

    I select the shared datasource from the data source propeties dialog, test the connection and everything is good.
    I add a dataset by selecting "use a dataset embedded in my report" option within the Dataset properties dialog.
    I select the newly added data source, click the "Stored procedure" query type and drop down the list box and select my intended stored procedure.
    the timeout for the dataset is "0" seconds.
    I click the "OK" button and I'm presented with the parameters to the stored procedure.
    I enter valid data for the parameters and click the "OK" button.
    I then get the following error message after 30 seconds:
    The problem is, all of the timeouts, that I'm aware of, have values of zero (no timeout) or high enough values that 30 seconds isn't even close to the timeout.
    I think the smallest timeout we have is 120 seconds.
    I have searched this site and many others and the solutions all involve altering the stored procedure to get the fields into report builder and then revert the stored procedure back to its original form.
    To me, this is NOT a solution.  
    I have too many stored procedures that need to be brought into Report Builder.
    I need a real solution.
    Thank you for you time, Tim Caldwell.
    Timothy E Caldwell

    I don't mean to be rude, but really, check to see if the stored procedure can return data rows???
    Maybe I'm not being clear enough.
    The stored procedure runs perfectly fine.
    it runs perfectly fine in the production environment and the test environment.
    I can access the stored procedure in several ways and have it return correct data.
    I can even trick report builder into creating a dataset with parameters and run the stored procedure that way.
    What I cannot do, is to get report builder to not timeout after 30 seconds on the initial creation of a dataset with a Query type of stored procedure.
    I have seen this issues posted again and again and again on may different sites and the "solution" is to simplifiy the stored procedure by creating a stored procedure that has a create table and a select in the stored procedure and that's it.  After
    report builder creates the dataset the developer then has to replace the simplified stored procedure with the actual stored procedure and everything works fine after that.
    HOWEVER, having to go through this process for 70 or more stored procedures is ridiculous.
    It would appear that there is something within report builder itself that is causing this issue.
    The SQL Script included is an example of a stored procedure that will not create fields create a dataset with fields and parameters in Report Builder 3.0:
    USE [CRUM_IT]
    GO
    /****** Object: StoredProcedure [dbo].[COGNOS_Level5ScriptSP] Script Date: 11/17/2014 08:02:26 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER procedure [dbo].[COGNOS_Level5ScriptSP]
    @CompanyCode varchar(8) = null,
    @GetSiblings varchar(1) = 'N'
    as
    Begin
    -- get emergency contact info
    select *
    into #tmp_Contacts
    from
    (select
    ConEEID,
    con.connamelast as [Emer Contact Last Name],
    con.connamefirst as [Emer Contact First Name],
    con.connamemiddle as [Emer Contact Middle Initial/Name]--,
    ,ROW_NUMBER() over (Partition by ConEEID order by ConNameLast)as rn
    ,ISNULL(
    case when con.conphonepreferred = 'H'
    then '(' + substring(con.conphonehomenumber, 1, 3) + ')' + substring(con.conphonehomenumber, 4, 3) + '-' + substring(con.conphonehomenumber, 7, 4)
    else '(' + substring(con.conphoneothernumber , 1, 3) + ')' + substring(con.conphoneothernumber , 4, 3) + '-' + substring(con.conphoneothernumber , 7, 4)
    end,
    ) as [Emergency Phone]
    from [ultiprosqlprod1].[ultipro_crum].dbo.Contacts con
    where con.ConIsEmergencyContact='y'
    and con.ConIsActive='y'
    ) A
    where A.rn = 1
    CREATE TABLE #tmp_CompanyCodes (CompanyCode varchar(8))
    If @GetSiblings = 'Y'
    Begin
    INSERT INTO #tmp_CompanyCodes (CompanyCode)
    EXEC [z_GetClientNumbers_For_ParentOrg_By_ClientNumber] @CompanyCode
    End
    INSERT INTO #tmp_CompanyCodes
    values (@CompanyCode)
    select *
    into #tmp_Company
    from [ultiprosqlprod1].[ultipro_crum].dbo.Company
    where cmpcompanycode in (select CompanyCode from #tmp_CompanyCodes)
    select distinct
    cmpcompanycode as [Client ID],
    CmpCompanyDBAName as [Client Name],
    eec.eecEmplStatus AS [Employment Status],
    eec.eecEmpNo AS [Employee Num],
    rtrim(eep.eepNameLast) AS [Last Name],
    rtrim(eep.eepNameFirst) AS [First Name],
    isnull(rtrim(ltrim(eep.eepNameMiddle)), '') AS [Middle Initial/Name],
    rtrim(eep.eepAddressLine1) AS [Address Line 1],
    isnull(rtrim(eep.eepAddressLine2), '') AS [Address Line 2],
    eep.eepAddressCity AS [City],
    eep.eepAddressState AS [State],
    CASE
    WHEN len(eep.eepAddressZipCode) > 5 and charindex(eep.eepAddressZipCode, '-', 1) = 0
    THEN substring(eep.eepAddressZipCode, 1, 5)
    ELSE rtrim(eep.eepAddressZipCode)
    END AS [Zip code],
    CASE
    WHEN len(eep.eepAddressZipCode) > 5 and charindex(eep.eepAddressZipCode, '-', 1) = 0
    THEN substring(eep.eepAddressZipCode, 6, 4)
    WHEN len(eep.eepAddressZipCode) > 5 and charindex(eep.eepAddressZipCode, '-', 1) > 0
    THEN substring(eep.eepAddressZipCode, charindex(eep.eepAddressZipCode, '-', 1) + 1, 4)
    WHEN len(eep.eepAddressZipCode) <= 5
    THEN ''
    END AS [ZIP + 4],
    substring(eep.eepSSN, 1, 3) + '-' + substring(eep.eepSSN, 4, 2) + '-' + substring(eep.eepSSN, 6, 4) AS [SSN],
    isnull(convert(VARCHAR(10), eep.eepDateOfBirth, 101), '') AS [Date Of Birth],
    eetFED.TAXCODE AS [FED Tax Code],
    eetFED.FILINGSTATUS AS [Fed Filing Status],
    eetFED.EXEMPTIONS AS [Fed Exemption Allowance],
    eetFED.ADDITIONAL AS [Additional Fed Withholding],
    eetSIT.TAXCODE AS [SIT Tax Code],
    eetSIT.FILINGSTATUS AS [State Filing Status],
    eetSIT.EXEMPTIONS AS [State Exemption Allowance],
    eetSIT.ADDITIONAL AS [Additional State Withholding],
    isnull('(' + substring(eep.eepPhoneHomeNumber, 1, 3) + ')' + substring(eep.eepPhoneHomeNumber, 4, 3) + '-' + substring(eep.eepPhoneHomeNumber, 7, 4), '') AS [Home Phone],
    isnull((SELECT cod.codDesc
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.Codes cod WITH (NOLOCK)
    WHERE cod.codCode = eep.eepEthnicID
    AND cod.codDosTable = 'ETHNICCODE'), '') AS [Race-Origin], --eep.eepEthnicID AS [Race-Origin],
    eep.eepGender AS [Gender],
    isnull(convert(VARCHAR(10), eec.eecDateOfOriginalHire, 101), '') AS [Original Hire Date],
    isnull(convert(VARCHAR(10), eec.eecDateOfSeniority, 101), '') AS [Seniority Date],
    isnull(convert(VARCHAR(10), eec.eecDateOfTermination, 101), '') AS [Termination Date],
    isnull(eecTermType,'') as [Termination Type],
    isnull(TchDesc, '') as [Termination Reason],
    rtrim(eec.eecJobCode) AS [WC Code],
    isnull(eec.eecJobTitle, '') AS [Job Title],
    pgr.pgrPayFrequency AS [Pay Frequency],
    eec.eecFullTimeOrPartTime AS [Full/Part Time],
    eec.eecSalaryOrHourly AS [Pay Type],
    isnull(convert(MONEY, eec.eecHourlyPayRate), 0.00) AS [Hourly Rate],
    isnull(eec.eecAnnSalary, 0.00) AS [Annual Salary],
    [YTD Hours],
    isnull(eep.eepNameFormer, '') AS [Maiden Name],
    eec.eecLocation AS [Location ID],
    rtrim(eec.eecOrgLvl1) AS [Department ID],
    eec.eecorglvl2 AS [Cost Item],
    eec.eecorglvl3 as [Client Project],
    eec.eecPayGroup as [Pay Group],
    isnull(eepAddressEMail,' ') as [Email Address],
    isNull(BankName1,' ') as PrimaryBank,
    isNull(BankRoute1,' ') as PrimaryRouteNum,
    isNull(Account1,' ') as PrimaryAccount,
    isNull(AcctType1,' ') as PrimaryAcctType,
    isNull(DepositRule1,' ') as PrimaryDepositRule,
    isNull(BankName2,' ') as SecondaryBank,
    isNull(BankRoute2,' ') as SecondaryRouteNum,
    isNull(Account2,' ') as SecondaryAccount,
    isNull(AcctType2,' ') as SecondaryAcctType,
    isNull(DepositRule2,' ') as SecondaryDepositRule,
    isNull(
    CASE
    WHEN DepositRule2 = 'D'
    THEN '$' + convert(varchar, cast(EddAmtOrPct2 AS decimal(10,2)))
    WHEN DepositRule2 = 'P'
    THEN convert(varchar, cast((EddAmtOrPct2*100) AS decimal(10,0))) + '%'
    ELSE null
    END,' ') as SecondaryDepositAmount,
    isNull(BankName3,' ') as ThirdBank,
    isNull(BankRoute3,' ') as ThirdRouteNum,
    isNull(Account3,' ') as ThirdAccount,
    isNull(AcctType3,' ') as ThirdAcctType,
    isNull(DepositRule3,' ') as ThirdDepositRule,
    isNull(
    CASE
    WHEN DepositRule3 = 'D'
    THEN '$' + convert(varchar, cast(EddAmtOrPct3 AS decimal(10,2)))
    WHEN DepositRule3 = 'P'
    THEN convert(varchar, cast((EddAmtOrPct3*100) AS decimal(10,0))) + '%'
    ELSE null
    END,' ') as ThirdDepositAmount,
    Supervisor,
    eec.eecEEID AS [Employee EEID],
    eec.EecJobCode As [Job Code],
    isnull(eec.EecTimeclockID,' ') As [Time Clock ID],
    con.[Emer Contact Last Name],
    con.[Emer Contact First Name],
    con.[Emer Contact Middle Initial/Name],
    con.[Emergency Phone]
    from [ultiprosqlprod1].[ultipro_crum].dbo.empPers eep WITH (NOLOCK)
    inner join [ultiprosqlprod1].[ultipro_crum].dbo.empComp eec WITH (NOLOCK)
    ON eep.eepEEID = eec.eecEEID
    inner join #tmp_Company cmp WITH (NOLOCK)
    ON eec.eecCOID = cmp.cmpCOID
    inner join [ultiprosqlprod1].[ultipro_crum].dbo.PayGroup pgr WITH (NOLOCK)
    ON eec.eecPayGroup = pgr.pgrPayGroup
    left outer join [ultiprosqlprod1].[ultipro_crum].dbo.TrmReasn
    on tchCode = eecTermReason
    left join (select CAST(sum(isnull(eee.eeeYTDHrs,0.00))AS DECIMAL(18,2)) as [YTD Hours],
    eeeEEID,
    eeeCOID
    from [ultiprosqlprod1].[ultipro_crum].dbo.EmpEarn eee with (NOLOCK)
    group by eeeCOID,eeeEEID)eee
    on eec.eecEEID = eee.eeeEEID
    and eec.eecCOID = eee.eeeCOID
    left join (SELECT eetCOID AS COID,
    eetEEID AS EEID,
    eetTaxCode AS TAXCODE,
    eetFilingStatus AS FILINGSTATUS,
    eetExemptions AS EXEMPTIONS,
    eetExtraTaxDollars AS ADDITIONAL
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.empTax WITH (NOLOCK)
    WHERE eetTaxCode = 'USFIT'
    )eetFED
    ON eec.eecCOID = eetFED.COID
    and eec.eecEEID = eetFED.EEID
    left join (SELECT eetCOID AS COID,
    eetEEID AS EEID,
    eetTaxCode AS TAXCODE,
    eetFilingStatus AS FILINGSTATUS,
    eetExemptions AS EXEMPTIONS,
    eetExtraTaxDollars AS ADDITIONAL
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.empTax WITH (NOLOCK)
    WHERE eetTaxCode like '%SIT'
    AND eetIsWorkInTaxCode = 'Y'
    )eetSIT
    ON eec.eecCOID = eetSIT.COID
    and eec.eecEEID = eetSIT.EEID
    left outer join (SELECT eddCOID,
    eddEEID,
    eddEEBankName BankName1,
    eddEEBankRoute BankRoute1,
    eddAcct Account1,
    EddAcctType AcctType1,
    EddDepositRule DepositRule1,
    EddAmtOrPct EddAmtOrPct1
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.EmpDirDp WITH (NOLOCK)
    WHERE eddSequence = '99')edd
    ON eec.eecCOID = edd.eddCOID
    and eec.eecEEID = edd.eddEEID
    left outer join (SELECT eddCOID,
    eddEEID,
    eddEEBankName BankName2,
    eddEEBankRoute BankRoute2,
    eddAcct Account2,
    EddAcctType AcctType2,
    EddDepositRule DepositRule2,
    EddAmtOrPct EddAmtOrPct2
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.EmpDirDp WITH (NOLOCK)
    WHERE eddSequence = '01')edd2
    ON eec.eecCOID = edd2.eddCOID
    and eec.eecEEID = edd2.eddEEID
    left outer join (SELECT eddCOID,
    eddEEID,
    eddEEBankName BankName3,
    eddEEBankRoute BankRoute3,
    eddAcct Account3,
    EddAcctType AcctType3,
    EddDepositRule DepositRule3,
    EddAmtOrPct EddAmtOrPct3
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.EmpDirDp WITH (NOLOCK)
    WHERE eddSequence = '02')edd3
    ON eec.eecCOID = edd3.eddCOID
    and eec.eecEEID = edd3.eddEEID
    left outer join (SELECT eecCOID,
    eecEEID,
    rtrim(eepNameLast) + ', ' +
    rtrim(eepNameFirst) + ' ' +
    isnull(rtrim(ltrim(eepNameMiddle)), '') AS [Supervisor]
    FROM [ultiprosqlprod1].[ultipro_crum].dbo.EmpComp WITH (NOLOCK)
    join [ultiprosqlprod1].[ultipro_crum].dbo.EmpPers with (NoLock)
    on eeceeid = eepeeid)eec2
    ON eec.eecSupervisorID = eec2.eecEEID
    left outer join #tmp_Contacts con
    on eep.eepEEID = con.ConEEID
    order by [Client ID],
    [Last Name],
    [First Name]
    drop table #tmp_Contacts
    END
    Timothy E Caldwell

  • Crystal Report and stored procedure calls

    Hi,
    1.   I am trying to access a Stored Procedure through Crystal Reports 2008. I have 3 Parameters in it and now I need the 2 Parameters from the stored Procedure to be given by User and the 3rd Parameter should be passed from the backend code. Please help me with the setps that would help me do this.
    2.I also have another Stored procedure where I have 3 parameters and in addition to that I should provide two other parameters for user to enter. Now the total number of parameters will be 5 Parameters. Can any one let me know how to implement all these parameters.
    3. In another Storedprocedure I have two Parameters which are discrete and multi select and both of them are cascaded. How do I implement those.
    Thanks
    Pradeep

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • Crystal Reports 9 and Stored Procedures using supplied parameters from user

    Hi,
    I have a Crystal Reports 9 report that prints and works fine.  It requests from the user 2 pieces of data which both are String data and not nulls.  I want to use the same report in a Visual Basic.Net 2003 program.  I can pull the report onto the form and it runs wonderfully.  I want to make it run programatically with out prompting for the user to key in the parameters.  I can supply them from an existing data file.  I have tried many things but have lacked the solution. 
    How can I pass the parameters from VB.Net 2003 to the stored procedure which runs the Crystal Report with in the VB.Net 2003 program.
    I appreciate all help and comments.
    Can this be done or do I need to just re-write the report in VB.Net 2003?
    Thanks,
    Norman

    Hi, Norman;
    It sure is possible to pass parameters to a Stored Procedure via our .NET SDK.
    Have a look at these samples:
    https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/9043bbbc-ae66-2b10-ce96-b48f9e25a450
    There are samples showing passing parameters.
    Regards,
    Jonathan

  • Java Persistence API and creation of databases

    Hi All
    I have designed a small address book application which uses a database to store the information. I have used the new Java Persistence API to take care of my transactions and querrys with the database. This works great for one set database which is generated the first time the application runs and is used all the time.
    However I would like to make it so that the user can create a new address book (database) with a different name, I am not sure how I would do this using the Java Persistence API. I know the persistence.xml file must be placed in the META-INF directory of the source, so how would I be able manipulate the file or could I place the file somewhere else.
    David

    I am using the Derby database. I can create a database by passing the create command when I create the entity Manager like so:
    Connection c = DriverManager.getConnection("jdbc:derby:AddressBook;create=true", "app", "app");My problem is that as I understand it the persistence.xml file must know the name of the database. Unless there is another way of setting this. The line in the persistence file I am referring to is:
    <property name="toplink.jdbc.url" value="jdbc:derby:AddressBook"/>I wonder if I can progamatically set this value so that I have a default database in the persistence.xml and others can then create there own.
    David

  • Multithreading and stored procedures

    Hi,
    Does anyone know of any problems with calling a stored procedure that returns a reference cursor in a multithreading application? In other words, if I have multiple threads calling the same stored procedure is the reference cursor guarenteed to be unique to each thread/thread safe?
    Thanks in advance,
    Glenn

    That should work fine and each call will get a separate ref cursor as long as the app is written properly and is managing it's threads anbd handles properly. Are you seeing some behaviour that suggests this is not the case?
    Chris

  • Oracle 8i and stored procedures

    Hi I was hoping someone could point me to the right direction here.
    I have been using SQL server before and often use stored procedures. I understand that if you want to use stored procedures you will use the CallableStatement object and the prepareCall method of the Connection object like so:
    let's say my stored proc has 2 number parameters:
    CallableStatement cs = con.prepareCall( " { call <stored_proc_name> (?, ?) } );
    cs.getString(1, 1);
    cs.getString(2, 2);
    ResultSet rs = cs.executeQuery( );
    where con is my connection object that i used to connect to my database. So far am I right with the following code?
    But my problem is I have to use Oracle 8i. So what is the equivalent of SQL server stored procs in Oracle? Is it functions? Procedures? Or Java Stored Procedures? I have been reading all these sites and the forums for ideas but still haev no clue what approach I should take
    I have managed to connect to my db using the thin drivers and have successfully passed SQL statements. Although, I don't want to pass SQL statements, I want to use stored procedures. With SQL server I would create all my stored procedures and use my beans to call these stored procedures. So as a new user of Oracle 8i coming form SQL server, what approach do I use and how?
    Thanks in advance for all the help!

    Alright well looks like I'm stuck now.
    This seems more like a PL\SQL question though. If I want to return 2 or more values do I use function or a procedure? here's the code I made:
    CREATE OR REPLACE FUNCTION sign_in(username VARCHAR(20), userpassword VARCHAR(20))
    RETURN NUMBER IS id_num NUMBER, user_type VARCHAR(1);
    BEGIN
    SELECT * INTO id_num, user_type
    FROM ID_MASTER idm, PERSON prs
    WHERE USERNAME = username
    AND USER_PASSWORD = userpassword
    AND idm.ID_NUM = prs.ID_NUM;
    RETURN id_num, user_type;
    END;
    now according to Oracle this is an invalid function. But the error message doesn't say much. Basically I want to pass 2 parameters to use for a query and return 2 variables from the result of the query. Am I suppose to use a procedure?
    If I pass paramters do which string do I use to prepareCall: "{ ? = CALL sign_in (?, ?) }" or do I use the "{ CALL sign_in (?, ?) }"
    But my problem right now is how to make the proper stored procedure. I'd be very much obliged to anyone who can give a sample. Thank you all for your time!

Maybe you are looking for

  • Why does CS6 no longer export images out at their boundary/artboard size? Am I missing something?

    I recently upgraded to Illustrator CS6, and suddenly clients have been remarking that the file sizes are wrong or there's "a ton of white space around the logo." I checked it out, and sure enough, it appears that whenever I export a file, it does not

  • What are the normal Boot time?/Wake from sleep time? for MB?

    Looking to buy a MacBook for my wife to replace her old Dell D-420. The Dell still works fine but takes forever to boot and to wake from hibernation. I was given an old iBook a few weeks ago and was amazed at how fast it woke from sleep mode (the boo

  • Hard drive suddenly full

    The 320 gig harddrive says full. Were do you find what is making it full? Why did it fill up? I delete photos as I transfer them to external drives. I am a photographer.

  • Import from XML

    hi... i hav some data from flat files which i hav converted to xml files. is there some way i cud use sqlloader to import this into a table. i do not want to involve hibernate in between. thanx in advance

  • Can't download new podcasts or recent book purchases in iTunes

    I can't download new podcasts or recent book purchases in iTunes. I'm using iTunes 10.6.1 on a MacBook Pro running OS 10.7.4. This started a week ago. I unsubscribed and resubscribed to my podcasts (no luck). I whitelisted the possible sending domain