Inspecting sql_query in PreparedStatement

When executing code in debug mode in JDeveloper, it's nice to use the Inspect feature.
My problem is this: I've set a break in a method that has been passed a PreparedStatement (and nothing else).
Using the inspector, I can see that one of the class variables is sql_query, and it's set to the string that the PreparedStatement class compiled. But why I can't see that same variable programatically? It doesn't seem to be in the PreparedStatement or Statement source code. It would be really nice to print the sql string on a catch if anything goes wrong. Anyone have any suggestions?

Please enclose your output within tag so that people here can read it easily and help you. Also the reason that why you want to remove rowid?
Salman
Edited by: Salman Qureshi on Mar 20, 2013 3:53 PM                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Follow-up action : please help - Inspection Lot related

    Hi,
    I am having the following trouble:
    Through MB02, a printout is generated to the local printer (LOCL).
    However, through QA11, when we save, we have a custom follow-up action attached that pops-up a
    dialog screen.
    The follow up action is triggered when a usage decision is changed for the inspection lot.
    The follow-up action (configured in IMG) calls a Function Module and a screen, which in turn populates
    a value into a custom DB table (based on the buttons, on the screen, sending either to LOCL or to a
    zebra printer).
    Now, what has to happen is that after inserting the value into a custom table, it should also open a sapscript and output.
    The Sapscript and print program are there, with the print program being created 3-4 years ago by someone
    else. However, even though we have code in the print program to update nast, in turn creating a message
    for output (1st the custom DB table is checked to see if the values match, MATNRCHARG), It does not update
    NAST. When we go through MB02, it does, but this should happen automatically after selecting one of the radio
    buttons on the original pop-up & selecting print.
    Please help. I don't know what to do and can't enable a debugger from the pop-up and if going though QA11,
    I can't get it to stop inside the print program (only inside the custom FM).
    Cheers,
    John

    hi
    kindly check whether this FM will work for you QFOA_OBJECT_STATUS_SET
    regards
    thyagarajan

  • How to print Integrity sql in the preparedstatement?

    How to print Integrity sql in the preparedstatement?
    Connection conn = null;
    String sql = "select * from person where name=?";
    PreparedStatement ps = conn.prepareStatement(sql);
    ps.setObject(1, "robin");
    ps.executeQuery();
    i'm wants print Integrity sql.
    For example:select * from person where name='robin'
    How should I do?
    thanks a lot!

    PreparedStatement doesn't offer methods for that. You can write your own implementation of PreparedStatement which wraps the originating PreparedStatement and saves the set* values and writes it to the toString().
    If needed, myself I just print the sql as well as the values-being-set to the debug statement.Logger.debug(query + " " + values);

  • A/P Credit memo after GRIN Quality Inspection

    Hi all,
    We have to implement GRIN Quality Check module for one implementation. What we have done in the add on that for one GRIN, we go to Quality Check Program where item wise we enter the Accepted Quantity and Rejected Quantity . Then for all the Rejected Quantity we move the items from Raw Material W/Hs (GRIN W/Hs) to Rejection W/Hs and then create the invoice for complete GRIN Quantity for all the items . We have thought  to return back the rejected items using A/P Credit memo which will both nullify the Invoice affect as well as Stock Affect . But there is a problem that we are encountering during A/P Credit memo :
    When we perform Copy From from A/P Invoice to A/P Credit Memo , all the details form A/P Invoice are copied don to A/P Credit memo , but we want to return the goods not from RM WHs but from the Rejection WHs as we had already moved the Rejected Items stock to Rejection WHs ,when we change the code of Warehouse from RM WHs to Rejection WHs , it removed the tax code from Tax Code columns for that row and later does not even allow to edit the Tax Code for that row without which we are not able to save the A/P Credit memo.
    please suggest the best way of implementing the complete scenario so that we could both be able to maintaining the separate stock of Rejected Items, Return it back after creating the complete Invoice . We also wanted to create the complete invoice after GRIN irrespective of the no. of items rejected.
    Thanks and Regards,
    Pooja Singh.

    Hi,
    Might be I have elaborated too much thats why I have not received any solution so far.
    Actually I just want to confirm one thing first, that we are working for GRIN Inspection as follows :
    1. GRIN
    2. Inspection of all the items in a particular GRIN
    3.Stock Transfer of Rejected Items to Rejection Locations
    4.Now we want to create Complete Invoice that is invoice for Complete Quantity irrespective of Rejected Qty.
    5.Now Returning back the Rejected Qty of items from Rejection Whs and Credit note for Vendor to reduce the due balance.
    But when I try to create A/P Credit memo from AP invoice I want to change the WhsCode from RM Whs to Rehection Whs which if done , Tax code disaapears and disables.
    What should be done.
    Thanks and Regards,
    Pooja Singh.

  • Error while uploading Inspection plan

    Dear Friends,
    I am creating inspection plans using BDC. The MIChas 2 versions. When i am using version 1, the inspection plan is created. Whereas when i am using MIC version 2 i am getting error "error occured while checking type group".Kindly let me know how do i resolve this.
    Regards
    Vivek

    Hi,
    Thanks for the reply. when i am trying to create a inspection plan in other plant, we have 4-5 sampling procesures to select from. But for this perticular plant where we are having problem, its showing only one. How do i get more options?How do i extend a sampling procedure to a new plant.
    Vivek
    Edited by: vivek mankad on Feb 23, 2010 7:57 AM

  • Error while creating Inspection plan

    Hi,
    While creating inspection plan in QP01, system is showing error  "Material type ZROH is not defined for task list type Q''
    Please help me to solve the error.
    Thanks
    Prasant

    Hi,
    This is due to the configuration error,
    Just use T.Code OP50
    Create an entry for task list type "Q" with material type "ZROH" and save,
    Then try creating a Quality Inspection Plan, it will work
    Regards
    Merwyn

  • PreparedStatement not working

    Hi,
    I am having some problem using PreparedStatement.executeUpdate() . I want to be able to prepare several queries before commiting and I wrote this just to test it
    PreparedStatement stmt= aConnection.prepareStatement("update trans_test1 set field1='a text field' where field1='other text'");
              stmt.executeUpdate();
              aConnection.commit();
              stmt.close();
              aConnection.close();
    when it hits this line "stmt.executeUpdate();" the program just stops running and after a while throws this error.
    java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
    I set the auto commit to false but I still can't get it working and do not understand the problem. Any one can help?
    Thanks so much
    Alejo

    Hi,
    I am having some problem using
    PreparedStatement.executeUpdate() . I want to be able
    to prepare several queries before commiting and I
    wrote this just to test it
    PreparedStatement stmt=
    aConnection.prepareStatement("update trans_test1 set
    field1='a text field' where field1='other text'");
              stmt.executeUpdate();This is wrong in so many ways:
    (1) Use the bind variables.
    (2) Close resources properly in a finally block.
    (3) You don't show where you set auto commit to false
    (4) You don't show where you rollback in the event of a failure.
    >
    I set the auto commit to false but I still can't get
    it working and do not understand the problem. Any one
    can help?A snippet like this isn't enough. Post all the code.
    Which database are you using, and which driver?
    %

  • Creation of inspection lot 04 depending on production version

    Hi Experts,
    could you tell me if it is possible to create a Good Receipt inspection (lot origin 04) depending on the production version used ?
    My material has 2 production versions:
    0001 - production with process order
    0002 - production with repetitve manufacturing
    When I do a GR on process order, I do not want to create an inspection lot 04.
    When I do a GR on product cost collector, I want to create an inspection lot 04.
    As I have entered inspection types in material master data, I do not know how to do the distinction ?
    Thanks in advance for your help
    Best regards
    Amaury

    Hi
    Check user exit
    QBCK0003 |Extended QM check for goods receipt
    Regards
    Sujit

  • Oracle, SELECT IN and PreparedStatement.setArray

    I want to execute the following query: SELECT * FROM SOMETABLE WHERE IDFIELD IN (?)
    The number of values in the IN list is variable. How can I do this with a prepared statement?
    I am aware of the different alternatives:
    1) Keep a cache of prepared statement for each sized list seen so far.
    2) Keep a cache of prepared statements for different sizes (1, 5, 10, 20) and fill in the left over parameter positions with the copies first value.
    They both have the disadvantage that there could be many prepared statements for each query that get used once, and never used again.
    I have tried this:
    stmt.execute ("CREATE OR REPLACE TYPE LONGINTLIST AS TABLE OF NUMBER(15)");
    ArrayDescriptor desc = ArrayDescriptor.createDescriptor ("LONGINTLIST", conn);
    long idValues [] = {2, 3, 4};
    oracle.sql.ARRAY paramArray = new oracle.sql.ARRAY (desc, conn, idValues);
    PreparedStatement query = conn.prepareStatement ("SELECT * FROM MYTABLE WHERE ID_FIELD IN (?)");
    query.setArray (1, paramArray);
    But Oracle gives a data conversion error.
    I then tried this:
    PreparedStatement query = conn.prepareStatement ("SELECT * FROM MYTABLE WHERE ID_FIELD IN (SELECT * FROM TABLE (?))");
    This works and the rows are returned, but the Oracle optimizer does not like it very much, since it always does a full table scan even though there is a primary key index on ID_FIELD.
    Any ideas?
    I also tried this:
    OraclePreparedStatement oraQuery = (OraclePreparedStatement) query;
    oraQuery.setARRAY (1, paramArray);
    But same behavior.
    Roger Hernandez

    Please re-read the original message. As I mentioned,
    I am aware of the two commonly used alternatives.No actually the most used alternative is to build the SQL dynamically each time.
    I know how to get both of them to work, and have used
    both alternatives in the past. The downside to both
    these approaches is that you need to save multiple
    prepared statements for each query. What I am trying
    to find is a way of having only one saved prepared
    statement for a query having a variable number of IN
    clause parameters.You could probably use a stored procedure that takes an 'array' and then do the processing in the stored proc to handle each array element.
    However, your database might not support that stored procs or arrays. Or it might not cache it with arrays. And the overhead of creating the array structure or processing it in the proc might eat any savings that you might gain (even presuming there is any savings) by using a prepared statement in the first place. Of course given that you must be using an automated profiling tool and have a loaded test environment you should be able to easily determine if this method saves time or not.
    Other than that there are no other solutions.

  • Cannot Record Material Inspection Results as per wiki use case * SOLVED *

    === EDIT ===
    Playing around, I solved my issue.
    I did not realize that I needed to set both flags
    CloseIndicatorSpecified  = true;
    CloseIndicator = false;
    Adding that fixed it; I suspect I cannot set them to null even if the WSDL allows it.
    Michel.
    === ORIGINAL POST ===
    Hi,
    I have a project to integrate SAP and our LIMS using the SAP web services with the Material Inspection business object.
    In the Wiki, there are a few [use cases|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/ESpackages/IntegrationofQualityManagementSystems] on the subject.
    Following that, I successfully retrieve all the required data using the following web services:
    [Find Material Inspection Basic Data by Elements|https://wiki.sdn.sap.com/wiki/display/ESpackages/FindMaterialInspectionBasicDatabyElements]
    [Find Material Inspection Subset Operation by Elements|https://wiki.sdn.sap.com/wiki/display/ESpackages/FindMaterialInspectionSubsetOperationbyElements]
    [Find Subset Operation Inspection Activity Basic Data by Elements|https://wiki.sdn.sap.com/wiki/display/ESpackages/FindSubsetOperationInspectionActivityBasicDatabyElements]
    [Read Subset Operation Inspection Activity|https://wiki.sdn.sap.com/wiki/display/ESpackages/ReadSubsetOperationInspectionActivity]
    From there, I want to record results. According to the Wiki , I should use
    [Record Subset Operation Inspection Activity Result|https://wiki.sdn.sap.com/wiki/display/ESpackages/RecordSubsetOperationInspectionActivity+Result]
    I tried directly through the [WS Navigator|http://sr.esworkplace.sap.com/webdynpro/dispatcher/sap.com/tcesiespwsnavui/WSNavigator] to test web services. Whenever go through that tho, I get the following error:
    Conversion Error: Invalid Input Format (701 SFB)
    Obviously, I get the exact same error using c# (at least I'm consistent!)
    Below is the code (some is truncated because it is too long but I think you can get the idea).
    The question: Can anyone help me understand why I am getting that error? Maybe there is one or more property I don't understand... It would be practical if the actual failing property was identified in the LogItem, but it is not.
    Some things I tried (to no avail):
    1. Tried all sort of combination for actionCode
    2. Removed actionCode and set actionCodeSpecified = false
    3. Removed the Measure property
    4. Removed the Text property
    5. Removed the ChangeStateID
    Thanks in advance!
    Michel
    ...RequestMessage_sync messageIn = new ...RequestMessage_sync();
    messageIn.MaterialInspection = new u2026RequestMessage_syncMaterialInspection();
    messageIn.MaterialInspection.ID = new MaterialInspectionID();
    messageIn.MaterialInspection.ID.Value = "3265";
    messageIn.MaterialInspection.ChangeStateID = "1";
    messageIn.MaterialInspection.Subset = new u2026RequestMessage_syncMaterialInspectionSubset();
    messageIn.MaterialInspection.Subset.ID = new InspectionSubsetID();
    messageIn.MaterialInspection.Subset.ID.Value = "0";
    messageIn.MaterialInspection.Subset.Operation = new u2026RequestMessage_syncMaterialInspectionSubsetOperation();
    messageIn.MaterialInspection.Subset.Operation.ID = "0300";
    u2026RequestMessage_syncMaterialInspectionSubsetOperationInspectionActivity activity = new u2026RequestMessage_syncMaterialInspectionSubsetOperationInspectionActivity();
    activity.ID = "0010";
    activity.CloseIndicatorSpecified = false;
    activity.Result = new u2026RequestMessage_syncMaterialInspectionSubsetOperationInspectionActivityResult[1];
    activity.Result[0] = new u2026RequestMessage_syncMaterialInspectionSubsetOperationInspectionActivityResult();
    activity.Result[0].ID = "0001";
    activity.Result[0].AcceptanceStatusCodeSpecified = false;
    activity.Result[0].DefectNumberValueSpecified = false;
    activity.Result[0].ExceptionIndicatorSpecified = false;
    activity.Result[0].InspectedNumberValueSpecified = false;
    activity.Result[0].Comment = string.Empty;
    activity.Result[0].NonConformingUnitNumberValue = 0;
    activity.Result[0].Measure = new Measure();
    activity.Result[0].Measure.Value = decimal.Parse("4.15";);
    activity.Result[0].Measure.unitCode = "AMP";
    activity.Result[0].Text = new Text();
    activity.Result[0].Text.Value = "Some Text Here";
    activity.Result[0].actionCode = ActionCode.Item01 |ActionCode.Item02 | ActionCode.Item03;
    activity.Result[0].actionCodeSpecified = true;
    activity.CloseIndicatorSpecified = false;
    messageIn.MaterialInspection.Subset.Operation.InspectionActivity = activity;
    messageIn.MessageHeader = new BasicBusinessDocumentMessageHeader();
    messageIn.MessageHeader.ID = new BusinessDocumentMessageID();
    messageIn.MessageHeader.ID.Value = "starlims_update";
    try
          u2026ConfirmationMessage_sync messageOut = ws.MaterialInspectionSubsetOperationInspectionActivityResultRecordingRequestConfirmation_In(messageIn);
          if (messageOut.Log.Item != null)
                string message = String.Empty;
                foreach (LogItem item in messageOut.Log.Item)
                      message += (item.Note + "\n");
                MessageBox.Show(message);
    catch (Exception ex)
          MessageBox.Show(ex.Message);
    Edited by: Michel Roberge on Jul 16, 2008 2:38 PM

    See post for solution.

  • Problem with PreparedStatement

    I'm using a statement which needs to determine if the value is in a group.
    The statement will be
    "select name,age,occupation from personnel where age in ?"
    ps.setString(1, "(20,21,22)");
    I've also tried
    ps.setString(1, "('20','21','22')");
    Neither brings back any values in the result set.
    I can't figure out how to print what the preparedstatement looks like after setting the value.
    I look in the table and there are records with age 20, 21, 22.. and age is set as a string.

    Try this:
        query_B = "select tablename.blah_blah_blah"
                + "  from tablename"
                + " where tablename.etc is null"
                + "   and table.blah_term_code       in (?, ?)"
                + " order by 1, 2, 4, 7";
          String[] in_sem_dt = { "200307", "200308" };
          pstmt_B = con.prepareStatement( query_B );
          pstmt_B.setString( 1, in_sem_dt[0] );
          pstmt_B.setString( 2, in_sem_dt[1] );
          rs_B = pstmt_B.executeQuery();~Bill

  • Inspection lot  is not getting updated in quant

    Hi Experts,
    Need your help..
    I have posted two material doc with same material following is the consequences :
    1.we have immediate TO creation process , so now we have 2 TO's and 2 inspection lots.
    2.When i am doing UD for first inspection lot PCN does get created.
    3.Now i do TO confirmation for putaway for TR and then TO creation and confirmation for PCN and material is in bin.
    4.When i am confirming the TO(TR i.e putaway TO) ,Inspection lot  is not getting updated in the quant due to which i am not able to convert PCN to TO
    Because in quant i found previous inspection lot which is different from having in PCN document.
    So is there any solution which will update the inspection lot in quant once we confirm TO(putaway TO) ?
    Any help on this will be highly appreciated.
    Regards,
    OM

    Hi jugen,
    Thanks for you help but now i going for below development :
    Once UD is done system will take the inspection lot from from the quant and will overwrite to the
       newly created PCN
    So that during PCN to TO creation (LU04) inspection lot will remain same both in quant and PCN .
    Do you have any idea on this i mean where in QA32 tcode i have to write this logic ?
    Thank you..
    Regards,

  • Inspection Characteristic is not being displayed in the inspection lot

    I have created a Calibration order by first creating method, then a MIC, same is attached to a task list and then a Plan.
    But when i trigger a order for that task list the inspection characteristics as mentioned in the task list does not appear in the order.
    Please let me know how to get the inspection characteristics in the order.
    I have checked the task list, in that the Inspection characteristics is visible.
    Please help
    Praneet

    I have noted one thing, in inspection lot the sample size is shown as zero for the equipment where the inspection characteristic is not being displayed and it is shown as one for the lot where the inspection characteristic is displayed.
    Both the Inspection lot the task list is same
    Please reply

  • How to inspect web app using safari and ipad and USB cable?

    On my mac I have
    OSX 10.10.2 (14C109)
    Safari Version 8.0.3 (10600.3.18)
    On my Ipad 2 (MC769X/A) i have
    OS 8.1.3 (12B466)
    Safari Web Inspector "on"
    Javascript "on"
    There are no "privacy" or "private mode" settings that I can see.
    I physically connected my iPad to my Mac and chose that I trust this computer. Confirmed that it's connected by looking in iTunes (and quit iTunes afterwards).
    I opened a web app on my iPad that's running on my local server, and then opened safari on the mac.
    I then opened the Develop menu and can see the ipad. The menu does not contain any other entries other than "Use for development..."
    My mac also shows "No inspectable applications", whatever that means.
    If I choose "Use for development" under the iPad menu, nothing at all happens and the menu item disappears.
    To get the iPad sub-menu back again I have to quit Safari and then re-open it.

    I'm sorry I don't buy this as an answer because:
    it's for a question that is 2 years old and for older devices. My devices are all the latest version
    I have XCode and I'm a member of the develop program already.
    XCode does not offer a way to create a project or other pairing between safari on the mac and on the ipad, since that is a built in feature of Safari
    It works with IOS Simulator, but not with the actual device even when all correct steps have been followed to pair / connect them
    The problem I'm trying to resolve works in IOS Simulator but does not work on an actual device.

  • Closing PreparedStatements & ResultSets

    Is it necessary to explicitly close ResultSet AND PreparedStatement objects when used together? For example:
    PreparedStatement ps;
    ResultSet rs;
    String sql = " SELECT * FROM some_table WHERE id = ? ";
    try {
        ps = connection.prepareStatement(sql);
        ps.setString(1, someId);
        rs = ps.executeQuery();
        // And so on.....
    } finally {
      rs.close();
      ps.close();
    }Is it sufficient to close only the PreparedStatement? Does the ResultSet get cleaned up automatically when the PreparedStatement is closed? I don't want any lingering cursors left open, but at the same time, I don't want to write code that isn't needed. What's considered best form?
    Thanks.
    BTW: I'm using Oracle 8i/9i.

    I always close a Statement object, but don't worry about the ResultSet...that's really just a matter of redundancy...
    From the API on Statement.close()
    Note: A Statement object is automatically closed when it is garbage collected. When a Statement object is closed, its current ResultSet object, if one exists, is also closed.

Maybe you are looking for

  • Remote Interface

    Hey. I was wondering if there was a way to enumerate the remote interface used by an RMI server if you do not have the RMI Client. Ive been looking at reflection but from what ive seen it assumes you know what type of object you will be dealing with.

  • Web Analysis loads Financial Reporting

    <p>I want to load from Web analysis, financial reporting. I can doit if i use an service launch executable. But I need to send thename of my report. I don´t know where I can do it. Couldanyone help me?</p><p> </p><p>Thanks</p>

  • Trying to install old PhotoShop Elements 2.0 but site does not recognize the serial number. Help?

    I am trying to install an old PhotoShop disk Elements 2.0 but during installation the site does not recognize the serial number I have on my registration form. Help?

  • Connecting Snow Leopard to Printer shared on XP Pro

    I am attempting to connect my Snow Leopard machine to my printer that is shared on my XP Pro machine. Here are the steps I have taken. 1. Printer shared on XP with printer name that is 12 characters or less 2. Verified the XP Firewall is set to allow

  • Wireless Security - DOES NOT WORK?

    My problem: AEBS works fine UNLESS I use any Wireless Security. If I set security to WEP, WPA/WPA2 Personal, or WPA2 Personal then the following occurs: -- the AEBS DOES NOT appear as a base station in AirPort Utility -- the Wireless Network DOES app