Mapping to store procedure

Hi,
I want to have a custom mapping to a database table. the only difference
that I need in synchronization between JDO and table is during insert. I
need to execute a store procedure that do actual insert in the table and
after that makes some other inserts in another table. I've already have
the code for that store procedure but I don't know how to make the mapping
between the JDO and table and insert stored procedure.
Thank you
Stefan

Stefan-
Check out the samples/timestampField/ directory in the Kodo 2.5.0
distribution for a simple example of using a custom mapping. You can
adapt this mapping to execute the custom logic when you need to do the
insert.
See also:
http://docs.solarmetric.com/javadoc/com/solarmetric/kodo/impl/jdbc/ormapping/ClassMapping.html#insert(com.solarmetric.kodo.runtime.StateManagerImpl,%20com.solarmetric.kodo.impl.jdbc.SQLExecutionManager)
In article <b5snsj$jkq$[email protected]>, stefan wrote:
Hi,
I want to have a custom mapping to a database table. the only difference
that I need in synchronization between JDO and table is during insert. I
need to execute a store procedure that do actual insert in the table and
after that makes some other inserts in another table. I've already have
the code for that store procedure but I don't know how to make the mapping
between the JDO and table and insert stored procedure.
Thank you
Stefan--
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com

Similar Messages

  • Map Fields, store procedure results is "Expr1000"

    Hi guys.
    This is my problem.
    I have a sql server 2005 database. In this database i have a store procedure (3100 lines, with temporal tables, unions .. etc).
    When i try to create the report in CR9, i do this :
    1) i'm go to "set datasource location"
    2) select the database
    3) select the store procedure
    4) put some parameters
    5) Accept
    When i want to add the fields to the report ....
    the only results from the SP is a result field called "Expr1000".
    I execute the store in my sql server and this give me all the columns results (174 columns).
    My question is:
    What is the error , that in CR9 i can't see all the columns results , and only i can see "Expr1000".
    Thanks !!!!!
    Pablo Reynoso.

    This is definitely not the solution for everyone but reading this thread made me do a little more checking on my own.
    I too was receiving the "Expr1000" field from the SP when linking it into a new report or even when trying to MAP fields in an existing report template.  In the Map Fields dialog the source SP had no fields displayed for Mapping.
    What I discovered was S.U.E. (stupid user error).  While testing some changes to the source SP I changed the return result from returning data to returning the actual sql code I was constructing in the SP.  I often write the code into a local string variable and then use the 'exec(@str);' command as the final step of the SP.  I changed that code to 'Select @str;' which returned the @str string value when I executed the SP from within SQL Manager - to see the actual sql code.
    I never changed the code back to using the 'exec(@str);' so I was returning a 4,000+ char string from the SP which when loaded into Crystal the SP "field" became "Expr1000".
    After making this little change, returning the data instead of a single LARGE string the report behavior returned to what is was before the testing snafu.
    Hope this helps someone else, at least maybe point them to their code changes and not necessarily the CR template.
    Dave

  • Call store procedure from pre-mapping

    Hi,
    I am currently working on OWB client version 10.2.0.4.36.My requirement is to call store procdure from pre-mapping tranformation.How to achieve this & how to pass parameters to the store procedure?
    Please let me know.
    Thanks,
    Siva

    Thanks for the quick reply.I am doing the same way as suggested.But am getting warning,when I validate it and is expecting to synchronize it.What warning you got exactly and i think you have not deployed the procedure.
    The reason for this procedure is to select max value from one of the table and then drop & recreate the sequence with max value + 1.
    Inside the procedure,am doing this all dynamically.which means am passing Columnname,tablename & sequencename to this procedure.
    Do you think is this good approach or any other advisable approach?Can you explain you requirement then only we can suggest the better way .
    Cheers
    Nawneet

  • How can i pass NULL value in Store Procedure?

    Hi guys,
    I am calling one store procedure from MS SQL Server 200, i had create the follow layout:
    But i need pass to MSQL SEVER the CPF = NULL, when i execute the procedre the CPF send empty value (not null).
    I already changed Communication Channel parammeter "Interpretation of Empty String Values" to "Null Value" value.
    But the interface always send empty string instead of null.
    How can anybody help me, please?
    Edited by: João Noberto dos Santos Junior on Jun 24, 2009 5:00 PM

    Hi,
    To achieve this through "Interpretation of Empty String Value" in the cc, you will have to implement a patch which is sent to you by SAP when an OSS is raised. By default its not available, i mean you can configure it but it will actually not work.
    As a temporary solution you can map your element with a constant/mapwithdefault field with value mentioned as NULL.
    Regards,
    Anshul

  • Calling ORACLE Store Procedure with parameters in user define function

    Hi everybody,
    We have a scenario connecting Oracle DB thru JDBC adapter.
    We have to call store procedure with input parameter and output parameter to retrieve data from DB. The implementation was made using JDBC adapter by building the correct XML message with EXECUTE action, and it works fine.
    Now we need to use DB lookup within mapping. I wrote users define function with SELECT statement (using the JDBC adapter) and it works fine but I need to call store procedure in ORACLE instead of SELECT statement.
    I found lot of examples concerning DB lookup but none of them explained how to write UDF calling store procedure in ORACLE with input and output parameters.
    I am looking for an example.
    Thanks in advance,
    Gigi

    I agree with you, but issue is we have lots of existing store procedure, which we need to call where damn required. I am sure those will be few but still i need to find out.
    If you think you are going to get existing MS Stored Procedures  or Oracle Packages that had nothing to do with the ORM previously to work that are not geared to do simple CRUD operations with the ORM and the database tables, you have a rude awakening
    coming that's for sure. You had better look into using ADO.NET and Oracle Command objects and call those Oracle Packages by those means and use a datareader.
    You could use the EF backdoor, call Oracle Command object and use the Packages,  if that's even possible, just like you can use MS SQL Server Stored Procedures or in-line T-SQL via the EF backdoor.
    That's about your best shot.
    http://blogs.msdn.com/b/alexj/archive/2009/11/07/tip-41-how-to-execute-t-sql-directly-against-the-database.aspx

  • How to pass xml data as objects into Database using store procedures

    Hi All,
         I don't have much knowledge on store procedure,can anybody help how to pass the xml as objects in Database using store procedure.
    My Requirement is I have a table with three fields EMPLOYEE is table name and the fields are EMP_ID,EMP_TYPE AND EMP_DET,I have to insert the employees xml data into corresponding fields in the table.
    Input Data
    <ROWSET>
       <ROW>
         <EMP_ID>7000</EMP_ID>
          <EMP_TYPE>TYPE1</EMP_TYPE>
         <EMP_DET>DEP</EMP_DET>
      <ROW>
      <ROW>
         <EMP_ID>7000</EMP_ID>
         <EMP_TYPE>TYPE2</EMP_TYPE>
        <EMP_DET>DEP2</EMP_DET>
    <ROW>
    <ROW>
         <EMP_ID>7000</EMP_ID>
         <EMP_TYPE>TYPE3</EMP_TYPE>
        <EMP_DET>DEP3</EMP_DET>
    <ROW>
    <ROWSET>
    So each row values has to inserted into resp fields in the table.
    Regards
    Mani

    Do you have a similar structure in your stored procedure ?
    In that case you can simply call the procedure from soa using db adapter and do a mapping to assign the values.

  • Testconnectivity fails at Mapi mail store Error 1818 Cancelled

    Hello
    I got one single Exchange 2010 SP3 Server installed. Everything working fine.
    I want to activate Outlook anywhere. Did this following the usual Procedure.
    I got everything activated, am listening on Ports 6001 6002 and 6004 on my exchange Server and i think everything is working fine. I also followed this article http://blogs.technet.com/b/exchange/archive/2008/06/20/3405633.aspx
    I can't get this Testexchangeconectivity Tool get working it always fails on this Point
    Trying to Ping the MAPI Mail Store "FQDN of Exchange:6001" with an RPC Error 1818 call cancelled.
    Any Ideas?
    Daniel Meili

    Hi,
    The error 1818 indicates that the RPC call timed out. From your description, I would like to clarify the following things for troubleshooting:
    1. Make sure that you have installed the Windows feature "RPC over HTTP Proxy".
    2. Disable Outlook Anywhere and wait a few minutes before you enable it again and check the result.
    What's more, here is a thread for your reference.
    ARR won't let through RPC
    https://social.technet.microsoft.com/Forums/office/en-US/8ad5a2c1-93b1-45ba-9d79-fe68c5711b09/arr-wont-let-through-rpc?forum=exchangesvrclients
    Hope this can be helpful.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Create oData service using oracle Store procedure

    Hello Experts,
    I need to create oData service from oracle store procedure,
    what are the steps to do it.
    We are using SMP Integration gateway.
    Please Suggest.
    Regards
    Manish

    Hello Experts,
    Here is my code to join 2 tables , in debug it does not give error, but it gives on only one table output not merged output.
    Please suggest.
    function processRequestSQL(message) {
      //Import statements
      importPackage(com.sap.gateway.ip.core.customdev.util);
      importPackage(java.util);
      importPackage(org.apache.olingo.odata2.api.edm);
      importPackage(com.sap.gateway.core.ip.component.commons);
      importPackage(org.apache.olingo.odata2.api.uri);
      importPackage(com.sap.gateway.ip.core.customdev.logging);
      //Get the SQL statement contained in message body
      var sqlStatement = message.getBody();
      var uriInfo = message.getHeaders().get(ODataExchangeHeaderProperty.UriInfo.toString());
      var map = new HashMap();
      map = uriInfo.getCustomQueryOptions();
      //Create the query and sub query
      var JOIN_WO_WHERE = "INNER JOIN ZONE ON AREA.AREA_ID = ZONE.AREA_ID ";
      var WHERE = " WHERE ";
      var JOIN = " INNER JOIN ZONE ON AREA.AREA_ID = ZONE.AREA_ID ";
      //Modify the SQL statement
      var modifiedSqlStatement = "";
      var entitySet = uriInfo.getStartEntitySet();
      var odataMethod = message.getHeaders().get(ODataExchangeHeaderProperty.ODataMethod.toString());
      modifiedSqlStatement += sqlStatement;
      if (odataMethod.toString() == "GET_FEED") {
      entitySetName = entitySet.getName();
      if (entitySetName == "AREA") {
      if (sqlStatement.indexOf("WHERE") != -1
      || sqlStatement.indexOf("where") != -1) {
      modifiedSqlStatement += JOIN_WO_WHERE;
      } else {
      // modifiedSqlStatement += WHERE;
      modifiedSqlStatement += JOIN;
      //Set the message body back with the modified SQL statement
      message.setBody(modifiedSqlStatement);
      //Logger
      log.logErrors(LogMessage.TechnicalError, "This is first log");
      //Set the message body back with the modified SQL statement
      message.setBody(modifiedSqlStatement);
      //Logger
      log.logErrors(LogMessage.TechnicalError, "This is first log");
    -------------------End Sample Implementation---------------------------------------
      return message;

  • HOW TO EXECUTE A STORE PROCEDURE THAT RETURN MULTIPLE ROWS FROM A QUERY

    I NEED TO CREATE AND USE A STORE PROCEDURE THAT IS GOING TO DO A SELECT STATEMENT AN THE RESULT OF THE SELECT STATEMENT IS RETURN IN SOME WAY TO THE REQUESTER.
    THIS CALL IS MADE BY AN EXTERNAL LANGUAGE, NOT PL/SQL OR FORMS APPLICATION. USING FOR EXAMPLE ODBC AND VISUAL BASIC. WHAT I NEED TO DO IS ADD A DATA ACCESS LAYER TO MY APPLICATION AND I ALREADY HAVE IT DONE FOR MS SQL SERVER, BUT I NEED THE SAME FUNCTIONALITY ACCESSING AN ORACLE DATABASE.
    FLOW:
    1. VB CREATE A ODBC CONNECTION TO A ORACLE DATABASE
    2. VB EXECUTE A STORE PROCEDURE
    3. THE STORE PROCEDURE RETURNS TO THE VB APPLICATION THE RESULT OF THE QUERY THAT IS INSIDE OF THE STORE PROCEDURE.(I.E. THE STORE PROCEDURE IS A BASIC SELECT, NOTHING COMPLEX)
    4. VB DISPLAY THE RESULT IN A GRID
    FOR SURE I CAN DO THE SELECT DIRECTLY TO ORACLE, BUT FOR PERFORMANCE REASONS AND SCALABILITY, I'LL LIKE IT TO DO IT USING A STORE PROCUDURES
    IS THIS POSIBLE?, HOW?
    THANKS

    Certainly, it's possible. First, define a stored procedure that includes an OUT parameter which is a REF CURSOR. Then, call the stored procedure via ODBC omitting the OUT parameter from the list of parameters. IT will automatically be returned as a result set. Syntax for both is below...
    CREATE PROCEDURE foo (inParam in varchar2, resultSet OUT REF CURSOR )
    In ODBC:
    {call foo( 'someData' )}
    Justin

  • UNABLE TO EXECUTE THE CMDSQL SCRIPT IN A STORE PROCEDURE.

    I am trying to call a .sql file from sql cmd mode.
    The requirement is to pass the .sql file as parameter value to the cmd script which I have able to achieve,here is the code which is working fine .
    declare @x sysname
    set @x = 'C:\Users\testuser\Desktop\testing.sql'
    :OUT $(TEMP)\GetServerName1.sql
    PRINT ':SETVAR FilePath'+ ' ' + @x
    GO
    :OUT stdout
    :r $(TEMP)\GetServerName1.sql
    GO
    :r $(FilePath)
    But when I try to wrap this code in store procedure it is giving the message fatal error but when I run it without wrapping it in store proc it is doing its job with no error . When I looked into the store proc I found the code as
    ALTER proc [dbo].[testing]
    as
    declare @x sysname
    set @x = 'C:\Users\testuser\Desktop\testing.sql'
    PRINT ':SETVAR FilePath'+ ' ' + @x
    It seems like the sqlcmd code disappears automatically. I have no clue why it is happening. 
    Can anyone help in letting me knw how to wrap the above code in store proc.
    Thanks Saurav 

    It is important to keep in mind that you have two entities in play here. One client and one server. The lines that start with a colon never sent to SQL Server, nor are the lines which reads "go". They are intercepted client-side. For instance :r
    instructs SSMS to read a local file and out: redirects the output. And "go" breaks up the code in batches.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Front-End Service Starup Error: Store procedure to GET progress vector failed.

    Hi,
    We have a two front end servers in our Lync deployment and I'm getting an interesting error message on one of the servers when the "Lync Server Front-End Service" is starting up. All the services on that server will eventually start but I'm pretty
    sure it's affecting users in some way.
    Here is the error message in the Event Viewer:
    Log Name:      Lync Server
    Source:        LS User Services
    Date:          2013-09-17 8:00:32 AM
    Event ID:      32194
    Task Category: (1006)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      BGC-VAN-LYNC2.domain.ca
    Description:
    Store procedure to GET progress vector failed.
    Execution Error: 0x00000000(ERROR_SUCCESS).
    Native Error: 8144.
    Error Details: [# [Microsoft][SQL Server Native Client 11.0][SQL Server]Procedure or function SyncReplicationGetProgressVector has too many arguments specified. #].
    Cause: This may indicate a problem with connectivity to local database or some unknown product issue.
    Resolution:
    Ensure that connectivity to local database is proper. If the error persists, please contact product support with server traces.
    Event Xml:
    <Event xmlns=>
      <System>
        <Provider Name="LS User Services" />
        <EventID Qualifiers="50158">32194</EventID>
        <Level>2</Level>
        <Task>1006</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2013-09-17T15:00:32.000000000Z" />
        <EventRecordID>16971</EventRecordID>
        <Channel>Lync Server</Channel>
        <Computer>BGC-VAN-LYNC2.domain.ca</Computer>
        <Security />
      </System>
      <EventData>
        <Data>0x00000000(ERROR_SUCCESS)</Data>
        <Data>8144</Data>
        <Data>[# [Microsoft][SQL Server Native Client 11.0][SQL Server]Procedure or function SyncReplicationGetProgressVector has too many arguments specified. #]</Data>
      </EventData>
    </Event>
    The error happens 15 times every minute, following with this event:
    Name:      Lync Server
    Source:        LS User Services
    Date:          2013-09-17 8:23:46 AM
    Event ID:      32189
    Task Category: (1006)
    Level:         Information
    Keywords:      Classic
    User:          N/A
    Description:
    The following Fabric service for routing groups have been closed:
    {F515134C-71B7-52FD-B0C3-6A9DB39CF750}
    {8A5D6B36-2A01-53DB-BC4E-3286C05E0836}
    {B35AAFC9-F6BF-5FFE-8C31-4AA5C36B2065}
    {69223418-78DC-5066-81A8-78E05914EC7B}
    {80414C96-1137-5DDC-8387-C3EA7A54B078}
    {641E6ABD-B862-55A1-B1B1-C83BC92D2F85}
    {1EA68EA4-77F7-5CFC-B781-0093CBC18403}
    {2FDE333D-FF7F-5D6A-B85B-93ADC1EAC12A}
    {A43BBA3A-8963-51C4-BD7A-19E1EC3DDFDB}
    {D3F4532F-61C8-5072-9B3B-3E2CCF15442F}
    {4449243E-5E96-56AC-AB6B-C5E785543542}
    {58B30261-65B6-5F6A-BC50-60F85782D052}
    {DB4B76B0-2510-5BF8-A7B1-8B37BD3AA7B9}
    {917CC217-966B-56AC-A912-97BA64BA13EB}
    Anyone knows what this is about and how to resolve this?
    Thanks,
    VH.

    Hi,
    Please try to reset registrar state:
    http://tsoorad.blogspot.in/2013/04/lync-2013-ee-pool-wont-start.html
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
    sure that you completely understand the risk before retrieving any suggestions from the above link.
    Kent Huang
    TechNet Community Support

  • Select all values from Rule in Store Procedure

    Hi
    I have a rule like this
    CREATE RULE [dbo].[Rle_Currency_Lst]
    AS
    @List IN
    ('PKR','USD')
    GO
    Now i want to make simple "Currency List" report for which i need to select values from above rule in Store Procedure which i will use in SSRS to fill my report.
    Please help
    Zubair Afridi | Please mark as answered or vote helpful if this post help resolved your issue. Thanks!

    One way to get the values.
    declare @definition nvarchar(max);
    select @definition = m.definition
    from sys.objects o
    inner join sys.sql_modules m on o.object_id = m.object_id
    where schema_name(o.schema_id) = 'dbo' and o.name = 'Rle_Currency_Lst';
    set @definition = SUBSTRING(@definition, CHARINDEX('''', @definition), LEN(@definition));
    set @definition = LEFT(@definition, CHARINDEX(')', @definition) - 1);
    declare @myXML AS XML;
    set @myXML = N'<H><r>' + REPLACE(SUBSTRING(@definition, CHARINDEX('''', @definition), LEN(@definition)), ',', '</r><r>') + '</r></H>'
    declare @result table(myvalues nvarchar(100));
    insert @result(myvalues)
    SELECT Vals.id.value('.', 'NVARCHAR(100)') AS val
    FROM @myXML.nodes('/H/r') AS Vals(id)
    update @result set myvalues = REPLACE(myvalues, '''', '');
    select * from @result;
    Note that rules is a deprecated feature and will be removed in a future version of SQL Server.  The replacement for rules is CHECK CONSTRAINTS.  You may well want to consider a plan to migrate your current rules to check constraints.
    Tom

  • How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000

    Post Author: ltkin
    CA Forum: WebIntelligence Reporting
    Hi,
    How to build a report in web Intelligence using Store procedure under Microsoft SQL Server 2000 ?
    Regards,

    Hi ltkin,
    Unfortunately, it is not possible in Xir2 to create Webi reports from stored procedures.
    Webi reports can only be created from Universe. So in Business Objects XIR3 we can create a special universe that enables Web Intelligence user's to access stored procedures residing in the database. This is the only way that Web Intelligence user's can access stored procedures.
    Please let me know if the above information helps.
    Regards,
    Pavan

  • How to get a recordset in vb to access a oracle store procedure.

    I have a store procedure(sproc) that needs to be called from a VB Application. I was being told that I would have to create a PL/SQL table in my store procedure for the VB Developer to access information from my store procedure. This is beacasue he wants it as a record set. Is that the way to get info for a VB front end. My sproc is a very basic one
    My sproc looks like
    create or replace PROCEDURE SP_TBLINFO
    (ID out TBLINFO.id%type,
    ACCOUNT_NUMBER out TBLINFO.account_number%type)
    AS
    CURSOR TBLINFO_CURSOR IS
    SELECT * FROM TBLINFO;
    V_TBLINFO_CURSOR TBLINFO_CURSOR%ROWTYPE;
    BEGIN
    OPEN TBLINFO_CURSOR ;
    Loop
    FETCH TBLINFO_CURSOR INTO V_TBLINFO_CURSOR;
    EXIT WHEN TBLINFO_CURSOR %NOTFOUND;
    ID := V_TBLINFO_CURSOR.id;
    ACCOUNT_NUMBER:= V_TBLINFO_CURSOR.account_number;
    END LOOP;
    CLOSE TBLINFO_CURSOR ;
    END SP_TBLINFO;
    Thanks.

    Use a REF_CURSOR, something like the following:
    create or replace package SP_TBLINFO as
    CURSOR TBLINFO_CURSOR IS SELECT * FROM TBLINFO;
    create type TBLINFO_CURSOR_TYPE is TBLINFO_CURSOR%ROWTYPE;
    procedure PROC_TBLINFO(Info out TBLINFO_CURSOR_TYPE);
    end;
    create or replace package body SP_TBLINFO as
    PROCEDURE PROC_TBLINFO
    (Info out TBLINFO_CURSOR_TYPE)
    AS
    BEGIN
    OPEN ACCOUNT_NUMBER as SELECT * FROM TBLINFO ;
    END SP_TBLINFO;
    END;
    Then bind it in OO4O as ORATYPE_CURSOR.

  • Unable to run Store Procedure based deski report in Infoview

    Hi All,
    I have a Deski report which is created using Store Procedure. I am able to run report in Full Client Deski. But I am unable to run / schedule same report thorough infoview.
    More details about report
    - Report uses 3 store procedures. When I ran report in infovew I get error message as "SP2 Dataprovider did not refresh properly".  -- SP2 is Dataprovider name.
    - Same report I am able to run in Dev environment. After migration to Model, report fails to run in model infoview.
    - I am able to Run report only for 1st. When I refresh and run with same parameter report shows error.
    Any input will be great help.
    Thanks,
    NV

    Hi,
    Could you please test the following solutions to resolve the issue.
    Solution1:
    Test the issue by inserting the following parameter in .SBO file.
    <Parameter Name="Force SQLExecute">Always</Parameter> .
    Solution2
    Just put SET NOCOUNT OFF in the end of the stored procedure SQL.
    If the above doesnu2019t works then please try the following solution.
    Solution3
    Make the new connection from the scratch using ODBC connection and test the issue.
    I hope this will help you.
    Regards,
    Sarbhjeet Kaur

Maybe you are looking for

  • RV_BELEG - Number Range Buffering

    Hi All:  I implemented parallel number range buffering for my client via transaction SNUM for object RV_BELEG which includes orders, deliveries, invoices, contracts, etc.  We did this because with the amount of users they have, when entering orders,

  • Force to used command line mouse settings ?!?

    Bravo for not including an option to disable mouse acceleration in the mouse settings. Had to used 2 command lines in the terminal.app to disable the so annoying and so not gaming friendly mouse acceleration... that thing is like dragging the mouse c

  • Rman backup scripts

    Hi, I am inquiring as to how to create a job to run an rman script without using the Enterprise manager to schedule and create the job. Thanks James

  • Do you Familier with Anritsu Equipment, and in the MP1201C specialy

    We received yesterday the BER analyzer MP1201C and it seems like we got the same "Operation Manual" twice, There are some commands and indications that are missing, for example: 1. If I want to know the status of the "Counting " led, (red color), by

  • What to use for Animated Cards.

    I would like to make some animated digital cards for the web. Like birthday cards etc.. Can I use Edge Animate or After Effects to do this?