How to get text of Last SQL Query

Sorry if this has been covered, but the search page keeps erring on me.
I am trying to figure out how to get the text of the last SQL statement executed (succesfully or unsuccesfully) by my current login.
What it is, is i want in the exception handler of my procedure to be able to dump the text of the Query which was last run into the log file.
Any help with this will be greatly appreciated!
Thanks in advance,
Aaron.
[email protected]

Well, ive been trying V$SQLTEXT in conjunction with V$SESSION and USERENV('SESSIONID'). This gets me my SQL statements, but the SQL_HASH_VALUE and PREV_HASH_VALUE, which are supposed to be the current and previous statements respectively always are the same and always point to the current statement..... is there some sort of flag you have to set to get PREV_HASH_VALUE (and PREV_SQL_ADDR) to actually point to the **PREVIOUS** statement??

Similar Messages

  • How to get this output using sql query?

    Hi,
      How to get this output using sql query?
    Sno Name Age ADD Result
    1 Anil 23 delhi Pass
    2 Shruti 25 bangalor Pass
    3 Arun 21 delhi fail
    4 Sonu 23 pune Pass
    5 Roji 26 hydrabad fail
    6 Anil 28 delhi pass
    Output
    Sno Name Age ADD Result
    1 Anil 23 delhi pass
    28 delhi pass

    Hi Vamshi,
    Your query is not pretty clear.
    write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
    Regards,
    Kannan

  • How to get # of rows in SQL Query ResultSet

    I need to get the # of rows in a sql query resultset so I can create arrays of the size of the # or rows returned. This is how I do it so far. Is there a better way without running the query twice?
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
         i++;     
    aid = new int;
    i=0;
    rs = stmt.executeQuery(query);
    while (rs.next())
         aid[i] = rs.getInt(1);
    Theres actually a few more arrays but for this I just used one to show what I was doing. Notice stmt.executeQuery needed to be called twice, once to get the count to set the size of the array and once to get the values.

    nope - there's no easy way.
    the right thing to do is to iterate through the ResultSet, load its contents into a List of Objects or some other data structure, and close it out right away. You can get the count of rows while you do it. return the contents in the object or data structure for clients to use. you should never be passing a ResultSet around.
    why do you need to know, anyway?
    %

  • How to get text when mousing over image?

    Hey there, I am extremely new to Flash, but know other Adobe programs so tend to learn quickly.
    I desperately need to find out how to get text to pop up when i mouse over PART of the image and i havent been able to find any help online in the last two days (pulling my hair out in stress).
    Now i uploaded a rough mock up i did on Photoshop, so you can see when i mouseover the top layer of the cake i need a line to stretch out and the text to pop up at the end of it. Similarly if i moused over the cherry another piece of text needs to come up in the same manor.
    Also since i need it to be a website link so what format do i open it with when i go to FILE- NEW?
    Honestly thank you so much in advance to anyone that helps

    First you have to choose if you want to handle devices. If not and you want to stay in Flash I'll stick on topic.
    In the HTML version you could either use a good old fashioned image map (they're still fine in the HTML5 era) or you could use a layering technique (here's a random layering example).
    In Flash you can do it a few different ways. If you intend on keeping the image intact as a single object then you'll be essentially doing the same as an image map. You can draw invisible hitareas on the various parts of the object and have those areas trigger a specific function that will display your text. If you break up the image into the separate parts then you can directly assign those parts to fire off a function themselves.
    First I'd like to know your desired direction.

  • How to add a parameter to sql query in report

    Hi
    How to add a parameter to sql query in report.
    Parameter is from Visual studio
    example:
    select * from tab1 where dl=parameter???
    I have VS 2008 prof CR XI R2, mysql

    Hello,
    If you have this API available then you can modify the record selection formulae in code to add filtering:
              string recordSelectionFormula = "{T_INV_RPT_ADDR.IND_PROMUS} = {?P_PROMUS?} AND {T_INV_RPT_POINT.INVOICE_DATE} = DATE(2008, 05, 31) AND {T_INV_RPT_POINT.CHECKOUT_DATE} = date(2008, 04,29)";
                CrystalDecisions.CrystalReports.Engine.ReportDocument.RecordSelectionFormula = recordSelectionFormula;
    You have to format and follow the rules as in the Designer so not too much work to get this to work.
    CR for .NET may not have the ability so you will need to upgrade to a Developer version of Crystal Reports.
    Thank you
    Don

  • How to get text verable value

    how to get text verable value
    Scenaior
    IN a query designer ,I had create a formula, this formual use two selection ,and this formula description must use text variable ,
    this variable must get current system time and make a offset like+1 or +2,how can i do this I know SAP have stander text variable 0cmontht can get current system time ,but It is can not offset
    any one can help me
    regard
    wenlong

    Hi Wenlong,
    U can create a text variable of type 'user exit' and wirte code in backend to offset the value.
    Regards,
    Rathy

  • How to get Text for nodes in Tree Structure

    Hi Friends,
    How to get Text for nodes in Tree Structure
    REPORT  YFIIN_REP_TREE_STRUCTURE  no standard page heading.
                       I N I T I A L I Z A T I O N
    INITIALIZATION.
    AUTHORITY-CHECK OBJECT 'ZPRCHK_NEW' :
                      ID 'YFIINICD' FIELD SY-TCODE.
      IF SY-SUBRC NE 0.
        MESSAGE I000(yFI02) with SY-TCODE .
        LEAVE PROGRAM.
      ENDIF.
    class screen_init definition create private.
    Public section
      public section.
        class-methods init_screen.
        methods constructor.
    Private section
      private section.
        data: container1 type ref to cl_gui_custom_container,
              container2 type ref to cl_gui_custom_container,
              tree type ref to cl_gui_simple_tree.
        methods: fill_tree.
    endclass.
    Class for Handling Events
    class screen_handler definition.
    Public section
      public section.
        methods: constructor importing container
                   type ref to cl_gui_custom_container,
                 handle_node_double_click
                   for event node_double_click
                   of cl_gui_simple_tree
                   importing node_key .
    Private section
      private section.
    endclass.
    *&                        Classes implementation
    class screen_init implementation.
    *&                        Method INIT_SCREEN
      method init_screen.
        data screen type ref to screen_init.
        create object screen.
      endmethod.
    *&                        Method CONSTRUCTOR
      method constructor.
        data: events type cntl_simple_events,
              event like line of events,
              event_handler type ref to screen_handler.
        create object: container1 exporting container_name = 'CUSTOM_1',
                       tree exporting parent = container1
                         node_selection_mode =
                cl_gui_simple_tree=>node_sel_mode_multiple.
        create object: container2 exporting container_name = 'CUSTOM_2',
        event_handler exporting container = container2.
    event-eventid = cl_gui_simple_tree=>eventid_node_double_click.
        event-appl_event = ' '.   "system event, does not trigger PAI
        append event to events.
        call method tree->set_registered_events
             exporting events = events.
        set handler event_handler->handle_node_double_click for tree.
         call method: me->fill_tree.
      endmethod.
    *&                        Method FILL_TREE
      method fill_tree.
        data: node_table type table of abdemonode,
              node type abdemonode.
    types:    begin of tree_node,
              folder(50) type c,
              tcode(60) type c,
              tcode1(60) type c,
              tcode2(60) type c,
              text(60) type c,
              text1(60) type c,
              text2(60) type c,
              end of tree_node.
      data:  wa_tree_node type tree_node,
                t_tree_node type table of tree_node.
    wa_tree_node-folder = text-001.
    wa_tree_node-tcode  = text-002.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-003.
    wa_tree_node-text1 =  'GR/IR aging'.
    wa_tree_node-tcode2 = text-004.
    wa_tree_node-text2 =  'Bank Balance'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    wa_tree_node-folder = text-005.
    wa_tree_node-tcode  = text-006.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-007.
    wa_tree_node-text1 =  'Creditors ageing'.
    wa_tree_node-tcode2 = text-008.
    wa_tree_node-text2 =  'Creditors ageing'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    wa_tree_node-folder = text-009.
    wa_tree_node-tcode  = text-010.
    wa_tree_node-text =  'Creditors ageing'.
    wa_tree_node-tcode1 = text-011.
    wa_tree_node-text1 =  'Creditors ageing'.
    wa_tree_node-tcode2 = text-012.
    wa_tree_node-text2 =  'Creditors ageing'.
    append wa_tree_node to t_tree_node.
    clear wa_tree_node .
    node-hidden = ' '.                 " All nodes are visible,
        node-disabled = ' '.               " selectable,
        node-isfolder = 'X'.                                    " a folder,
        node-expander = ' '.               " have no '+' sign forexpansion.
        loop at t_tree_node into wa_tree_node.
          at new folder.
            node-isfolder = 'X'.                      " a folder,
            node-node_key = wa_tree_node-folder.
                   clear node-relatkey.
            clear node-relatship.
            node-text = wa_tree_node-folder.
            node-n_image =   ' '.
            node-exp_image = ' '.
            append node to node_table.
          endat.
         at new tcode .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode.
             node-text = wa_tree_node-text .
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
          endat.
          append node to node_table.
        at new tcode1 .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode1.
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
              node-text = wa_tree_node-text1.
         endat.
          append node to node_table.
           at new tcode2 .
            node-isfolder = ' '.                          " a folder,
            node-n_image =   '@CS@'.       "AV is the internal code
            node-exp_image = '@CS@'.       "for an airplane icon
            node-node_key = wa_tree_node-tcode2.
                     node-relatkey = wa_tree_node-folder.
            node-relatship = cl_gui_simple_tree=>relat_last_child.
            node-text = wa_tree_node-text2.
         endat.
          append node to node_table.
        endloop.
        call method tree->add_nodes
             exporting table_structure_name = 'ABDEMONODE'
                       node_table = node_table.
      endmethod.
    endclass.
    *&                        Class implementation
    class screen_handler implementation.
    *&                        Method CONSTRUCTOR
      method constructor.
       create object: HTML_VIEWER exporting PARENT = CONTAINER,
                      LIST_VIEWER exporting I_PARENT = CONTAINER.
      endmethod.
    *&                 Method HANDLE_NODE_DOUBLE_CLICK
      method handle_node_double_click.
      case node_key(12).
    when 'Creditors'.
    submit YFIIN_REP_CREADITORS_AGING  via selection-screen and return.
    when  'Vendor'.
    submit YFIIN_REP_VENDOR_OUTSTANDING  via selection-screen and return.
    when 'Customer'.
    submit YFIIN_REP_CUSTOMER_OUTSTANDING  via selection-screen and
    return.
    when 'GR/IR'.
    submit YFIIN_REP_GRIR_AGING  via selection-screen and return.
    when 'Acc_Doc_List'.
    submit YFIIN_REP_ACCOUNTINGDOCLIST  via selection-screen and return.
    when 'Bank Bal'.
    submit YFIIN_REP_BANKBALANCE  via selection-screen and return.
    when 'Ven_Cus_Dtl'.
    submit YFIIN_REP_VENDORCUST_DETAIL via selection-screen and return.
    when 'G/L_Open_Bal'.
    submit YFIIN_REP_OPENINGBALANCE via selection-screen and return.
    when 'Usr_Authn'.
    submit YFIIN_REP_USERAUTHRIZATION via selection-screen and return.
    endcase.
      endmethod.
    endclass.
    Program execution ************************************************
    load-of-program.
      call screen 9001.
    at selection-screen.
    Dialog Modules PBO
    *&      Module  STATUS_9001  OUTPUT
          text
    module status_9001 output.
      set pf-status 'SCREEN_9001'.
      set titlebar 'TIT_9001'.
      call method screen_init=>init_screen.
    endmodule.                 " STATUS_9001  OUTPUT
    Dialog Modules PAI
    *&      Module  USER_COMMAND_9001  INPUT
          text
    module user_command_9001 input.
    endmodule.                 " USER_COMMAND_9001  INPUT
    *&      Module  exit_9001  INPUT
          text
    module exit_9001 input.
    case sy-ucomm.
    when 'EXIT'.
      set screen 0.
    endcase.
    endmodule.
            exit_9001  INPUT

    you can read  the table node_table with nody key value which imports when docubble click the the tree node (Double clifk event).
    Regards,
    Gopi .
    Reward points if helpfull.

  • How to display text on last but one page in SAPSCRIPTS

    how to display text on last but one page in SAPSCRIPTS

    u have create one Foooter window , this has to be called in  only One Page.So hardcode /assign this window to only one PAGE number.
    regards
    Prabhu

  • How to get login ID in SQL?

    Hi,
    How to get login Id in sql?
    such as "select * from table1 where userlogined=:{$loginid$}"?
    Best Regards,
    Jason Gao

    Hi,
    You would need to create a parameter in your report called userloginid select the paramter data type to match that of the datatype this value is stored as in the table.
    then the correct syntax would be select * from table1 where userloginid=:userloginid
    Hope this helps,
    Domnic

  • How to get Text from (.txt) file to display in the JTextArea ?

    How to get Text from (.txt) file to display in the JTextArea ?
    is there any code please tell me i am begginer and trying to get data from a text file to display in the JTextArea /... please help...

    public static void readText() {
      try {
        File testFile = new File(WorkingDirectory + "ctrlFile.txt");
        if (testFile.exists()){
          BufferedReader br = new BufferedReader(new FileReader("ctrlFile.txt"));
          String s = br.readLine();
          while (s != null)  {
            System.out.println(s);
            s = br.readLine();
          br.close();
      catch (IOException ex){ex.printStackTrace();}
    }rykk

  • Help: how  to get text from IFRAME

    <!-- The box where we type-->
    <IFRAME class="mytext" width="100%" ID="mytext" height="200">
    </IFRAME>
    someone can tell me how i get text in my servlet from
    <IFRAME>
    thankx in advance...

    someone can tell me how i get text in my servlet from
    <IFRAME>
    thankx in advance...Hmm. I think you are mixing something up here. Why would you use an IFrame for entering text? IFrame is used for including content from different HTML-pages inside your page.
    If you want to have a textbox for an user to enter text into and submit it to a server, you need a form and a textarea inside that. Like this:
    <form action="myServlet" method="post">
    <textarea name="myArea">
    </textarea>
    <input type="Submit" value="Ok">
    </form>Change the action in the form to reflect the mapping to your servlet.
    Then you can just do a String enteredText = request.getParameter( "myArea" ); inside your servlet.
    If you insist that you need to use an IFrame, I guess the only way to do it would be to write a Javascript function, that copies the contents from the IFrame to a hidden field before the page is submitted to your servlet. In your servlet you would read the value from the hidden field.
    .P.

  • How to get text lables in x axis for xcelsius bubble chart

    Hi
    How to get text values in x axis for xcelsius bubble chart
    I have data as follows
    x axis: closed/qualification/lost
    y axis: deal age
    z axis: amount(bubble size)
    Thanks

    If you are using Xcelsius 2008 SP3 you will be able to do this.

  • How to hide repeated details using SQL Query?

    How to hide repeated details using SQL Query?
    For Ex:
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    10 | BLAKE | CLERK |
    10 | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    20 | ADAMS | CLERK |
    20 | KING | SALESMAN|
    ------------------------+
    How we can display the above details in the following way?
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    | BLAKE | CLERK |
    | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    | ADAMS | CLERK |
    | KING | SALESMAN|
    ------------------------+
    Thanks Advance

    Hi,
    you can use BREAK ON DEPTNO in SQL*Plus or use LAG.
    SQL> ed
    Wrote file afiedt.buf
      1  select nullif(department_id
      2                , lag(department_id) over (partition by department_id order by last_name)
      3         ) dept_id
      4  , last_name, job_id
      5*  from employees where department_id in (30,50) and rownum <=10
    SQL> /
       DEPT_ID LAST_NAME                 JOB_ID
            30 Baida                     PU_CLERK
               Colmenares                PU_CLERK
               Himuro                    PU_CLERK
               Khoo                      PU_CLERK
               Raphaely                  PU_MAN
               Tobias                    PU_CLERK
            50 Fripp                     ST_MAN
               Kaufling                  ST_MAN
               Vollman                   ST_MAN
               Weiss                     ST_MAN
    10 rows selected.

  • Upgraded to kitkat this morning, messaging not working. Please advise how to get texting back.

    Cannot use Messaging after updating to KitKat. Says Messaging not available. Please advise how to get texting back.

        I want to ensure that you're device is running top notch! Do you receive the "Messaging not available" upon entering the Message app? I would suggest heading into Settings > Applications > Manage Applications > All and clearing data / cache from the app. If you don't see improve here I would suggest testing the device in Safe Mode: http://vz.to/1m9ArqO
    YosefT_VZW
    Follow us on Twitter @VZWSupport

  • HT202305 How to get text erase from I phone

    how to get text messages erase from I phone 6

    Do your contacts appear at http://www.iCloud.com after signing in?
    If so, you just follow the iCloud Setup instructions here: http://www.apple.com/uk/icloud/setup/mac.html

Maybe you are looking for

  • SNA Server on Ethernet cannot talk to AS/400 on token ring

    We have an SNA server on Ethernet and it cannot talk to a token ring device Q159462 from microsoft suggests to disable LLC local Acknowledgement. Does anyone have any suggestions and how can I disable LLC?

  • IPad 3 rear panel issues when charging

    Hi, I've ad my iPad around 2 month and I have never dropped or banged (touch wood) when it's charging the metal back seems to have a ever so slight current,  nothing like to give you a shock but it defiantly has something happening ? Has his happened

  • For query experts

    Hi All Here we have a new requirement from the customer asking us to create a new query. Now the problem is I have to include the 4 views on the application tool bar, it is similar to that we create 4 buttons on the application tool bar and manage wi

  • Use TaskQueryService via Axis2 Client - unrecognized operation: credential

    Trying to use the TaskQueryService via an Aixs2 client results in 'Unexpected subelement credential'. org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement credential      at org.apache.axis2.AxisFault.makeFault

  • Problem register a system with sconadm

    Hello guys, I'm trying to register a Solaris 10 6/06 u2 system using sconadm, but it fails: ryna# cat /tmp/RegistrationProfile.properties | grep -v ^# | grep -v '^$' userName=__deather password=XXXXXXX hostName= subscriptionKey= proxyHostName= proxyP