How to execute "begin transaction"

Hi Friends
I want to execute sql statement
A) begin trnsaction
B) do some trnsaction
c) commit
d) end transaction
But i am not able to execute statement A) using JDBC Statement class.
How to.
Please help.
Thanks in advance.

do this in the connection'
Connection c = DriverManager.getConnection("jdbc:adburl:\\blahblah");
c.setAutoCommit(false);// start a transaction
// do some work with statements here on this connection
if(success){
  c.commit();  // work is finished commit the changes
}else{
  // didn't like what happened?
  c.rollback();
}

Similar Messages

  • How to execute the transaction SCI

    Hi All,
    How to execute the transaction SCI
    Thank you,
    Sridhar.

    Hai ,
    there are two ways to use SCI , one is you open you code in se38 -->display mode --> Program >check>code inspector. here your program is executed with a dafault variant provided in SCI.
    Second method is go to SCI , create a inspection  an choose a variant , here system provide you with a wide range of program checks (security/syntax etc)
    For any further help.
    Do reply.
    Regards
    Jase

  • How to execute a transaction code in prod.Server from development server

    Hi Friends,
    How to execute a transaction code in prod.Server from development server,Pls give me your valuable suggestions...
    Regards,
    V.Balaji

    i have  a program in production system if i type the request and execute its sends a mail to my admin saying to transport the request to production system.....thats y??????
    just tell me ur idea.............

  • How to execute a transaction with a different user from the logged user?

    Hello Experts!
    I'm trying to find out a solution about this scenario: our users need to release a Purchase Order (ME28) and/or a Service Entry Sheet (ML85) in SAP from a WEB based application through TIBCO, but the requirement is to execute this operation with the same SAP User name of the user (with his authorization) and not with the TIBCO user that is logged to SAP.
    Is there someone that could suggest me a real time solution and how to develop it? I really appreciate your contribute and I'm at your disposal for any further information.
    Thank you very much!
    Alessandro

    Hi Rob!
    Thank you for your help, but I can't apply this solution, because we need to execute the transaction with a specific user name and not a generic user, besides our user have different authorization, for example the user Mr. Rossi can release only his Purchase Order but not the PO of another user Mr. Bianchi. Moreover we need to see the PO released/modified from a specif user name. So this is our constraint.
    Bye Ale.

  • How to execute ME22N transaction in background.

    Hi experts,
    How to execute ME22N and ME23N in background, when execute the transaction in background, , it should generate a spool, with out any printpreview. How can we do this....?
    thanks

    Hi,
    Write a BDC program for updation of tables for u r user-exit.
    After that Schedule u r program in back gound job scheduling.
    Using  SM36 - Define Background job.
    Give the job name and Press job wizard button.
    It's asking about job name and job class -prioritty.
    press continue and give program name .
    Select radiobutton based on u r requirement.
    Then specify periodic job or only in holidays.
    Then u select hours and all.
    In SM37 give u r job name and and press execute.
    Reward if useful.
    Regards,
    Narasimha

  • How to execute mb31 transaction code

    Hello,
        Please tell me how to execute mb31 tcode for creating a GR for Order.
    Even after giving a destination storage location, the material shows 0 stock in MMBE
    Please reply
    Thanks & regards,
    Priyanka

    give following details
    Document Date in Document : The document date is the date on which the original document was issued.
    Posting Date in the Document :Date which is used when entering the document in Financial Accounting or Controlling.
    Delivery NOTE: if you wish to give its external no range
    Moment type: 261
    Order: if you have order no any
    plant & Storage Location as required

  • How to execute SAP Transaction from cmd

    Hi, Dear All,
    How can we execute an SAP Transaction from the command prompt.
    Your inputs are highly appreacited.
    regards

    Go to the command prompt (CMD) and change to the directory where the SAPGUI software is located. Then, run: sapgui <hostname> <instance> Example: sapgui sapprd 00 This is a very fast way to start a SAPGUI session against the indicated SAP system and instance number.
    another way is to locate the file of logon pad
    in my system it was at C:\WINDOWS\SAPwksta\setup\SAL
    after that type saplogon.sal
    It will take you to the logon pad.

  • How to execute a transaction in specified user defined screen.

    Hi,
    I have created an alv tree in that I'm calling a transaction after double click on node of that tree. Please help me for to show the called transaction in user defined specified screen.
    Thanks in advance.

    i have  a program in production system if i type the request and execute its sends a mail to my admin saying to transport the request to production system.....thats y??????
    just tell me ur idea.............

  • [Execute SQL Task] Error: Executing the query failed with error: "The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION."

    I have an package with source , data flow and destination to execute on begin and commit.
    in the below i have just used for questioning purpose with diagram removing my Data Flow task explaining my problem
    on execution, i get error as
    [Execute SQL Task] Error: Executing the query "COMMIT TRAN DimCompanyCode" failed with the following error: "The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.". Possible failure reasons: Problems with the query, "ResultSet"
    property not set correctly, parameters not set correctly, or connection not established correctly.
    as mentioned , i have checked the ResultSet, parameters , connection establish.. all are fine.
    Kindly advice on what has to be done.
    ShanmugaRaj

    To avoid this error, the RetainSameConnection property should set to 'True' for the Connection Manager - Application_DB.
    Narsimha

  • How many times a transaction has been executed

    Hi All,
    I have to make a list on how many times certain transactions have been exectued last year.
    Does any of you have a idea on how to get this list?
    tried already ST03 and STAT but without satisfying result
    We have R/3 4.6B.
    Regards,
    Rod.

    hi,
    use STAD transaction.

  • How to Execute FEBP and FEBA transaction codes

    Hi All,
    Can you please explain me how to configure customizing for FINISTA in EBS.
    And also can you plz explain how to execute the t codes FBEP and FBEA.
    regards
    Madhavi

    Hi
    Enter T.Code: MIGO
    Select : Other
    Movement Type : 561
    In the item Details Entyer the material . enter the quantity. Plant and Storage Location.
    Save it. CHekc the Stock In MMBE for that material.
    Thanks & Regards
    Ram

  • How to execute Transaction Using JCO

    Hello Developper;
      Is it possible to execute Transactions using JCO API's or not ?
    If yes, can you please provide me with a snippets, from conecting to executing the Transaction and then getting the result.
    Regards
    Anis

    Hi Anis,
    I really don't understand the use of JCO if you to use it in the same SAP Box. As JCO is basically to have some front end applications without SAP GUI Client,
    Could you please let me know if I am not on the same level.
    Thanks,
    Hamendra

  • How to call a transaction from ABAP code

    Hi everybody,
    How do I run a transaction from my ABAP code?
    For example, through my ABAP code, I want to call the ME24 transaction (Maintain Purchase Order).
    Thanks for the help,
    Roy

    CALL TRANSACTION
    Syntax
    CALL TRANSACTION ta { [AND SKIP FIRST SCREEN]
                        | [USING bdc_tab [bdc_options]] }.
    Extras:
    1. ... AND SKIP FIRST SCREEN
    2. ... USING bdc_tab [bdc_options]
    Effect
    The statement CALL TRANSACTION calls the transaction whose transaction code is contained in data object ta. The data object ta must be of character type and must contain the transaction code in uppercase letters. If the transaction specified in ta cannot be found, an untreatable exception is triggered. The additions suppress the display of the initial screen and allow you to execute the transaction using a batch input session.
    At CALL TRANSACTION the calling program and its data is kept, and after exiting the called transaction, processing is resumed in the calling program after the call.
    When the transaction is called, the ABAP program linked with the transaction code is loaded in a new internal session. The session of the calling program is kept. The called program runs in an SAP LUW of its own.
    If the called transaction is a dialog transaction, after loading the ABAP program the event LOAD-OF-PROGRAM is triggered and the dynpro defined as initial dynpro of the transaction is called. The initial dynpro is the first dynpro of a dynpro sequence. The transaction is finished when the dynpro sequence is ended by encountering the next dynpro with dynpro number 0 or when the program is exited with the LEAVE PROGRAM statement.
    If the called transaction is an OO transaction (as of release 6.10), when loading all programs except class pools the event LOAD-OF-PROGRAM is triggered and then the method linked with the transaction code is called. If the method is an instance method, implicitly an object of the corresponding class is generated and referenced by the runtime environment. The transaction is finished when the method is finished or when the program is exited using the LEAVE PROGRAM statement.
    After the end of the transaction call, program execution of the calling program resumes after the CALL TRANSACTION statement.
    Note
    At the statement CALL TRANSACTION, the authorization of the current user to execute the called transaction is not checked automatically. If the calling program does not execute a check, the called program must check the authorization. To do this, the called program must call function module AUTHORITY_CHECK_TCODE.
    Addition 1
    ... AND SKIP FIRST SCREEN
    Effect
    This addition suppresses the display of a screen of the initial dynpro of a called dialog transaction. The addition AND SKIP FIRST SCREEN suppresses the first screen under these prerequisites:
    For the initial dynpro, in the Screen Painter the own dynpro number must not be specified as the next screen number.
    All mandatory input fields of the initial dynpro must be filled completely and with the correct values by the SPA/GPA parameters
    If these prerequisites are met, that screen of the dynpro is displayed that is specified in the Screen Painter as the next dynpro of the initial dynpro.
    Example
    If the static next dynpro of the initial dynpro of the called dialog transaction FLIGHT_TA is not the initial dynpro itself, its screen is suppressed, because its input fields are filled using the SPA/GPA parameters CAR and CON.
    DATA: carrid TYPE spfli-carrid,
          connid TYPE spfli-connid.
    SET PARAMETER ID: 'CAR' FIELD carrid,
                      'CON' FIELD connid.
    CALL TRANSACTION 'FLIGHT_TA' AND SKIP FIRST SCREEN.
    Addition 2
    ... USING bdc_tab [bdc_options]
    Effect
    Use this addition to pass an internal table bdc_tab of row type BDCDATA from the ABAP Dictionary to a dialog transaction. The additions bdc_options control the batch input processing. When a transaction with addition USING is called, the system field sy-binpt is set to value "X" in the called program - while this transaction is running, no other transaction can be called with this addition.
    The internal table bdc_tab is the program-internal representation of a batch input session and must be filled accordingly. The structure BDCDATA has the components shown in the table below.
    Component Description
    PROGRAM Name of the program of the called transaction
    DYNPRO Number of the dynpro to be processed
    DYNBEGIN Flag for the beginning of a new dynpro (possible values are "X" and " ")
    FNAM Name of a dynpro field to be filled or batch input control statement, for example, to position the cursor
    FVAL Value to be passed to the dynpro field or to the control statement
    Using the internal table bdc_tab, you can provide any number of screens of the called transaction with input and user actions.
    System Fields
    sy-subrc Description
    0 The batch input processing of the called transaction was successful.
    < 1000 Error in the called transaction. If within the transaction a message was sent, you can receive it using the addition MESSAGES.
    1001 Error in batch input processing.
    Note
    Outside of ABAP Objects you can specify the additions AND SKIP FIRST SCREEN and USING together. However, this does not make sense, because the addition AND SKIP FIRST SCREEN is desigend only to fill the mandatory input fields using SPA/GPA parameters, while the batch input table specified with USING controls the entire transaction flow including the display of the screens.
    Example
    Call of the Class Builder (transaction SE24) and display of class CL_SPFLI_PERSISTENT. The internal table bdcdata_tab contains the input for the batch input processing of the first dynpro (1000) of the transaction. Using structure opt, the batch input processing is set to suppress the first screen and to display the next screen in the standard size.
    DATA class_name(30) TYPE c VALUE 'CL_SPFLI_PERSISTENT'.
    DATA: bdcdata_wa  TYPE bdcdata,
          bdcdata_tab TYPE TABLE OF bdcdata.
    DATA opt TYPE ctu_params.
    CLEAR bdcdata_wa.
    bdcdata_wa-program  = 'SAPLSEOD'.
    bdcdata_wa-dynpro   = '1000'.
    bdcdata_wa-dynbegin = 'X'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_CURSOR'.
    bdcdata_wa-fval = 'SEOCLASS-CLSNAME'.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'SEOCLASS-CLSNAME'.
    bdcdata_wa-fval = class_name.
    APPEND bdcdata_wa TO bdcdata_tab.
    CLEAR bdcdata_wa.
    bdcdata_wa-fnam = 'BDC_OKCODE'.
    bdcdata_wa-fval = '=CIDI'.
    APPEND bdcdata_wa TO bdcdata_tab.
    opt-dismode = 'E'.
    opt-defsize = 'X'.
    CALL TRANSACTION 'SE24' USING bdcdata_tab OPTIONS FROM opt.

  • How many of the transactions woill be Roll backed?

    Hi friends,
    Could you please clarify That How many of the transactions will be rollbacked when we say ROLLBACK....?
    (For e.g., As a first transaction i used delete command to delete one row from a table of 10 rows....As a second transaction i used update command two times to update two records in the same table....Now i created one table ...after that i said rollback....So how many of the transactions will be rollbacked?)

    I'm sure blushadow has heard of all of those, but what does it have to do with the original question?
    SQL> CREATE TABLE t AS
      2  SELECT rownum id, TO_CHAR(TO_DATE(rownum, 'J'), 'Jsp') descr
      3  FROM all_objects WHERE rownum < 10;
    Table created.
    SQL> SELECT * FROM t;
            ID DESCR
             1 One
             2 Two
             3 Three
             4 Four
             5 Five
             6 Six
             7 Seven
             8 Eight
             9 Nine
    SQL> DELETE FROM t WHERE id = 1;
    1 row deleted.
    SQL> SAVEPOINT a;
    Savepoint created.
    SQL> UPDATE t SET descr = 'Deux'
      2  WHERE id = 2;
    1 row updated.
    SQL> SAVEPOINT b;
    Savepoint created.
    SQL> UPDATE t SET descr = 'Trois'
      2  WHERE id = 3;
    1 row updated.
    SQL> SELECT * FROM t;
            ID DESCR
             2 Deux
             3 Trois
             4 Four
             5 Five
             6 Six
             7 Seven
             8 Eight
             9 NineI agree that at this point, I can rollback to any point in these three statements, however, as soon as I do:
    SQL> CREATE TABLE t1 (id NUMBER);
    Table created.then the savepoints are gone
    SQL> ROLLBACK TO b;
    ROLLBACK TO b
    ERROR at line 1:
    ORA-01086: savepoint 'B' never establishedNow, the documentation says "If you use a SET TRANSACTION statement, then it must be the first statement in your transaction.", and the very first DELETE starts a transaction. and the fact that:
    SQL> SET TRANSACTION AUTONOMOUS;
    SET TRANSACTION AUTONOMOUS
    ERROR at line 1:
    ORA-00900: invalid SQL statementis invalid, even if you could use SET TRANSACTION within an already started transaction. I suppose you could do:
    SQL> DROP TABLE t1;
    Table dropped.
    SQL> TRUNCATE TABLE t;
    Table truncated.
    SQL> INSERT INTO T
      2  SELECT rownum id, TO_CHAR(TO_DATE(rownum, 'J'), 'Jsp') descr
      3  FROM all_objects WHERE rownum < 10;
    9 rows created.
    SQL> COMMIT;
    Commit complete.
    SQL> DELETE FROM t WHERE id = 1;
    1 row deleted.
    SQL> SAVEPOINT a;
    Savepoint created.
    SQL> UPDATE t SET descr = 'Deux'
      2  WHERE id = 2;
    1 row updated.
    SQL> SAVEPOINT b;
    Savepoint created.
    SQL> UPDATE t SET descr = 'Trois'
      2  WHERE id = 3;
    1 row updated.
    SQL> DECLARE
      2  PRAGMA AUTONOMOUS_TRANSACTION;
      3  BEGIN
      4     EXECUTE IMMEDIATE 'CREATE TABLE t1 (id NUMBER)';
      5  END;
      6  /
    PL/SQL procedure successfully completed.
    SQL> ROLLBACK to b;
    Rollback complete.but it seems like a lot of effort to get around something that you shouldn't be doing in the first place.
    John

  • How to execute a script(.sql) file from a PL\SQL procedure

    I would like to know how to execute a .sql file from a stored procedure and the result of it should update a table. My .sql file contains select statements.

    Hi!
    just go through the following piece of code -
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    str varchar2(200);
      3  begin
      4    str := '@C:\RND\Oracle\Misc\b.sql';
      5    execute immediate(str);
      6* end;
    SQL> /
    declare
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    ORA-06512: at line 5ORA-00900: invalid SQL statement
    Cause: The statement is not recognized as a valid SQL statement. This error can occur if the Procedural Option is not installed and a SQL statement is issued that requires this option (for example, a CREATE PROCEDURE statement). You can determine if the Procedural Option is installed by starting SQL*Plus. If the PL/SQL banner is not displayed, then the option is not installed.
    Action: Correct the syntax or install the Procedural Option.
    Regards.
    Satyaki De.

Maybe you are looking for