Can i extract no of columns fields as by using bind variables....

can i extract no of columns fields as by using bind variables....

SBH wrote:
I suppose you are asking for bind variable columns and their substituted values. You can query V$SQL_BIND_CAPTURE to view complete info about thatI've never had good luck with V$SQL_BIND_CAPTURE. Maybe its more robust since I tried on 9i several years ago; I could never find what I was looking for there :(
Edited by: riedelme on Jul 14, 2010 6:15 AM

Similar Messages

  • How can I extract the list of fields for every view of the material master?

    Hello SAPients,
    Is there a table or a FM where I can extract the list of fields that every view of material master have?
    I need to create a dynamic selection-screen with something like this:
    Basic Data
        mara-matnr
        makt-maktx
        mara-meins
    Sales: Sales Organization Data
        mara-matnr
        makt-maktx
    Thank you in advance.

    Hi
    Try to run the trx OMT3B: this the customizing where the dynpro for the views are defined: perhaps u can find something can help you.
    Max

  • Can I use bind variable instaed of writing static COLUMN Name

    Hi , I am having a table containing id and column names, the data is stored against that id in other tables. Now I wish to update data into another table so that it goes into apppropriate column without using decode function.
    I am trying to do this:
    EXECUTE IMMEDIATE 'update TEST set :1 = :2
    where PROJECT_ID= :3 and UNIQUE_ID= :4' using P_DEST_COLUMN, P_TEXT_VALUE, P_PROJ_ID, P_TASK_UID;
    the values P_DEST_COLUMN, P_TEXT_VALUE, P_PROJ_ID, P_TASK_UID are populated using a cursor in PL/SQl
    Is this statement valid? If not can you tell me how to do it as I am getting some error I am unable to comprehend.
    thanks
    Rishabh

    Column names cannot be substituted at run-time as bind variables. If you need to specify the column name at run-time, you'd need to construct a new string and execute that string dynamically, i.e.
    EXECUTE IMMEDIATE 'UPDATE test SET ' || p_dest_column || ' = :1 ' || ...From a data model standpoint, storing column names as data elements in another table is generally a rather poor idea. It's likely to make ad-hoc reporting nearly impossible and to cause a lot more parsing than would otherwise be required.
    Justin

  • How can I find number of columns in a table using a query

    Hi
    I want to find the number of columns in a table using a query.
    Any help in this regard is much appreciated.
    Cheers

    Hi,
    This is the output i get when i executed ur query
    OWNER     OBJECT_NAME     OBJECT_TYPE
    SMLDBO     T2311_SURVEY_QUESTIONS     TABLE
    select OWNER,OBJECT_NAME,OBJECT_TYPE
    from all_objects
    where OBJECT_NAME = 'T2311_SURVEY_QUESTIONS';
    works Fine.
    But if i use the below query it returns : 0
    SELECT count(*) FROM user_tab_columns
    WHERE table_name =upper( 'T2311_SURVEY_QUESTIONS');
    What could be problem.
    The table exists + name of the table is correct + it resides in my schema itself.
    Any guess !!!

  • How can I extract a dates column from an ascii file

    I am extracting data from an ascii file and the rest of the data is extracted using read from spreadsheet, but the date appears as just the day e.g. 22 for 22nd, how can I get the date, format in ascii is e.g 22/04/2006, can I do this by specifying something at format of read from spreadsheet ? Cheers
    Emily

    Hi,
    I found the other day that there are instructions included inside the Read From Spreadsheet vi on how to modify it slightly to read strings rather than doubles.
    If you drop the Read From Spreadsheet  vi onto the block diagram and double click on it, you will open the front panel for the vi. If you then select the block diagram (for Read From Spreadsheet) you will see an 'instructions' frame below the main 'code', and the 3rd paragraph tells you how to modify the VI to read the spreadsheet as a set of strings rather then doubles. Save the vi as a new filename when you've edited it or you will overwrite the existing vi!
    Using the newly modified vi you can read in your entire spreadsheet, extract the dates as strings, then do any conversion necessary to the other columns of the sheet to change them into the types of value you require (eg doubles).
    I hope this helps.
    Mark
    Applications Engineer
    National Instruments

  • DTP can Not extract data of date field from PSA to Target DSO

    Hi everyone.
    I enhanced several fields in datasource "2LIS_12_VCITM". that is date field "BLDAT" and another date type fields.
    The data of date type fields are extracted very well from datasource to PSA.
    But only field "BLDAT" among them are NOT extracted from PSA to target DSO.
    Another date type fields is good. but only "BLDAT" field is empty.
    I added "BLDAT" later than another date fields.
    Is that the reason??
    I don't know why.
    Let me know the solution. pls~~~~

    Hi,
    Try deleting and recreating the DTP and loading again.
    This solution refers to note 925941 and should be solved in SPS10.
    Best regards,
    Olav

  • How can I extract data from ST03 - what tables are used?

    Hi
    I currently have to create performance statistics daily for management. To do this I use transaction ST03 and manually copy the previous days Dialog average response time, DB, CPU and GU av. times into a spreadsheet, and also the average dialog response time for 4 key transactions from the transaction profile.
    It would be nice to automate this. I was thinking of writing a basic ABAP program to query the relevant tables to extract this data - does anyone know which tables are used? I'd tried running a trace but it was not clear which tables/rows etc would be required.
    Thanks
    Ross

    Ok, that FM is an old one - for NW2004s (700) need to use 'SWNC_COLLECTOR_GET_AGGREGATES'.
    Have a basic program below. What I'm trying to do is get the average response time for transactions. I can get 'respti' from the table but I think this is the total response time - what field represents average response time?
    Also, the numbers that it's pulling back don't seem to match the numbers in ST03 at all... except 'dcount'. This seems to correct ly show the number of steps... but the other values don't match anything. What am I doing wrong?
    Program below...
    Cheers
    Ross
    REPORT  Z_GETSTATS.
    PARAMETER: day TYPE dats DEFAULT sy-datum.
    DATA: t_usertcode  TYPE swnc_t_aggusertcode,
          wa_usertcode TYPE swncaggusertcode.
    START-OF-SELECTION.
    CALL FUNCTION 'SWNC_COLLECTOR_GET_AGGREGATES'
        EXPORTING
          component     = 'TOTAL'
          periodtype    = 'D'
          periodstrt    = day
        TABLES
          usertcode     = t_usertcode
        EXCEPTIONS
          no_data_found = 1
          OTHERS        = 2.
      LOOP AT t_usertcode INTO wa_usertcode.
             WRITE:/ wa_usertcode-entry_id.
             WRITE:/ wa_usertcode-respti, wa_usertcode-procti, wa_usertcode-cputi, wa_usertcode-dcount, wa_usertcode-ucount.
             WRITE:/ '*************************************'.
      ENDLOOP.

  • How can I extract a file name / path from a local path variable in TestStand?

    I have local TestStand string variable, call it 'locals.path', that contains a path to a file including the file name (c:\inputs\input.txt). I need to be able to split up the path (c:\input) and the file name (input.txt) and save them into 2 local variables. What is the best way to do this?
    After reading through some of the other forums, it looks like there are some built-in functions that can accomplish this, but I am unable to find how to use them anywhere on the NI web site. One forum said to use the File I/O>Strip Path.file function. How is this called? Is this function in a DLL?
    I know that there are a number of DLLs that are installed with TestStand into the c:\windows\system32 directory. One forum made note of CVI_OpenFile / CVI_ReadFIle functions in the cvirt.dll that I used to solve a problem that I had in the past. The problem is that I had no idea that that these functions even existed and would have never known unless a similar question had been posted previously. Is there some place that these DLL function interfaces are defined or documented? Is there a function that can extract the file name out of a string for me?
    Thanks,
    Mike

    Hi,
    There sound like functions in say LabVIEW or CVI.
    I have attached a small example which may help. (I have not allowed for any error trapping, if say you dont find the file and cancel)
    Regards
    Ray Farmer
    Message Edited by Ray Farmer on 10-16-2006 10:04 PM
    Regards
    Ray Farmer
    Attachments:
    Sequence File1.seq ‏33 KB

  • How can I extract cursor coordinate in Adobe Photoshop for use in Action script?

    What I want to do in Photoshop (version CC, but I think this applies to any version) is label a point using count tool under my mouse's current position, and label it multiple times (for different labels). I have an action that essentially does this:
    (1) Add to count (under one label) (2) Switch to second label (3) Add to count (under second label) (4) Switch to third label (5) Add to count (under third label)
    And the problem is that I need to be able to have a variable in the action script that uses the cursor's current position (X and Y numbers) on the canvas to set these three points when the macro is activated. Currently I am only able to record the script using constant X, Y values (the same point is labeled over and over when I play the recorded action). I am able to extract the code for the action for editing (via xbytor2's suggestion in this forum:https://forums.adobe.com/thread/696989) and I see where the variable can go, I just don't know what exactly to put in place of the constant X, Y values that will let Photoshop input the mouse's current coordinates...
    Any ideas? Much appreciated!!

    You could use the pen tool set to path and create a single dot, then run the script to get the cursor positions and use that in your script.
    var strtRulerUnits = app.preferences.rulerUnits;
    var strtTypeUnits = app.preferences.typeUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;
    var doc = activeDocument;
    var workPath = doc.pathItems.getByName("Work Path");
    var pos = workPath.subPathItems[0].pathPoints[0].leftDirection;
    $.writeln("x = " + pos[0] + " y = " + pos[1]);
    doc.pathItems.getByName("Work Path").remove();
    app.preferences.rulerUnits = strtRulerUnits;
    app.preferences.typeUnits = strtTypeUnits;

  • Can't extract long text from SAP command CN23 using VB script.

    Am writing a VB Script to copy all the long text for a network (SAP command CN23) into an excel spreadsheet cell. I do the GUI script recording, but when the script displays the long text screen, the script does not copy the text. How can the script select all the text and save it to a cell of an open excel spreadsheet? The text window does not seem to follow the same functionality as the rest of the SAP screens.

    hi satheesh,
    I tried to extract using winrar but could not
    cheers
    ram

  • How can I extract model dll information (inports, outports etc) using VeriStando API?

    Hi,
    I am working in a system that may run using the actual or modelled UUT. Besides this, it uses 3 heavy models running at 5 kHz.
    I am looking for a way to inspect the model dll and extract its information as System Explorer does when the model is included.
    Is it possible to do this using VeriStand API?
    Cheers,
    Cláudio H.
    CHCastro

    Hi Jarrod,
    This VI does what I am doing now but in a cleanner way.
    I made some changes to let it model independent.
    The point is: it is necessary to run the project to retrieve the model information. My feeling is that System explorer does this without run the project and this is what we would like to do.
    Other point: when we compile the model we fill the fields of information in "NI Information" which we want to retrieve. These information field are avaiable in system explorer during in4 creation.
    Is this possible?
    I am including the generic version of your VI that I changed.
    Cheers.
    Cláudio H.
    CHCastro
    Attachments:
    Simple LabVIEW API Example.zip ‏20 KB
    Simple LabVIEW API Example.zip ‏20 KB

  • How can I extract parts of the EXIF metadata to use in a Smart Collection?

    I want to aggregate all of the images I've captured by Capture Month and identify those images that were scanned or have no Capture Date.  This question actually attempts to open the door for read access to all of the image metadata and the ability to store some of it in user-identified fields which, somehow, the user will be able to populate.
    So - if the date fields (i.e. DateTime Original, DateTime Captured, DateTime Modified ) were broken down into, for example using DateTime Original:  Original Year-YYYY, Original Month-MM, Original Day-DD.  It may be possible to do this with a redefination of the schema used to define each of the fields.  That would be the simpliest, easiest way - if that's possible.
    If it isn't possible (or not in the near future, anyway) does anyone have any ideas?
    Thanks

    With over 45 years in IT (I know, it only means I'm an old man - not that I learned anything ), I observed that many of the problems I identified had simple solutions.  The reason they weren't in the original releases was, the testers felt "Why would someone want to do that?  Or need that data?  Or that field?"  Why would you hold an iPhone quite like THAT?
    Since Adobe defined the schema that captures the image metadata and defined what fields would be accessable and in what way; the most direct solution to this is to modify the schema through a redefinition of the date fields — all of them — so the individual elements are accessable.
    Also, because one of Lightroom's key features is image management, these new data fields should be accessible for Smart Collections.  There's at least one other person in this community who's interested in a By Month Across Year sort and I suspect many people don't speak up, even if they have a similar need.
    That's what I meant.  While outside developers (non-Adobe employees) might be able to come up with a patch for the solution, the underlying problem will still remain until Adobe acts.  Solving the problem is the less expensive means of dealing with the issue.
    I think.

  • Can't use bind variable in a function

    This is a repost from my earlier post at
    URGENT: Problem creating the report using Procedure
    The problem is when I bind a variable in a function, I get REP-0002. Please look at the following steps to reproduce
    ===
    set serveroutput on
    create or replace
    package Q_REP_test
    as
    type drec is record
    sdate date
    type dreccursor is ref cursor return drec;
    Procedure Get_sysdate(retdate out dreccursor);
    procedure add_days_tocurdate(no_of_days in number, retdate out dreccursor);
    end q_rep_test;
    show errors
    create or replace
    package body q_rep_Test
    as
    procedure Get_sysdate(retdate out dreccursor)
    is
    begin
    open retdate for
    select sysdate retdate from dual;
    end;
    procedure add_days_tocurdate(no_of_days in number, retdate out dreccursor)
    is
    begin
    open retdate for
    select sysdate+no_of_days retdate from dual;
    end;
    end q_rep_test;
    show errors
    ===
    Invoke the SP as follows:
    ===
    function QR_1RefCurDS return q_rep_test.dreccursor is
    tempc q_rep_test.dreccursor ;
    begin
    q_rep_test.add_days_tocurdate(:p_1,tempc);
    return tempc;
    end;
    ===
    1. Create a report
    2. create an user parameter(p_1)
    3. add a pl/sql as above
    4. run it(to verify the report works)
    5. save it.
    6. close the report
    7. Open it again, you get an as
    "REP-0002: Unable to retrieve a string from the Report Builder Message file". Now it is corrupted and can't be used at all.
    Please treat this as urgent and help me.
    Thanks

    Hi ,
    Though you have stated it as Oracle92iDS check whether it has the 9.0.2.2 patchset applied. If not please try applying the latest Patchset 9.0.2.2 for Oracle9i Reports.
    To download the patch goto Metalink <http://metalink.oracle.com/metalink/plsql/ml2_gui.startup> and search for Patch# 2842923.
    This Patchset is for iAS and iDS.
    In either case, please let me know the results.
    Thanks,
    Vinod.

  • What can i replace this bind variable with in function?

    Hello
    I am creating a report showing training attended by employees. I have written a function to do the following:
    Parameters 1 - 4 is hard coded for a reason. So we dont worry about them.
    5th parameter: :START_DATE represents the date training started
    6th parameter: :END_DATE represents the date training ended.
    These date parameters are correctly used inside the select statement that the function is built upon. So don't worry that my date parameters are correct/incorrect.
    The focus should be on how you use bind variables inside Discoverer Admin. The select at the bottom runs perfectly in Toad and it allows you to use the date parameters as bind variables. But it does not allow it in Discoverer Admin
    The problem is with Parameter 5 and 6. I dont want to hard code the dates as i want the user to be able to enter his own date parameters.
    Discoverer Admin gives an error is i want to use :START_DATE and :END_DATE as parameters
    Does anyone have a solution for my problem.
    This is what the code looks like.
    SELECT apps.xxhr_fsc_training_info.xxhr_fsc_training ('A', '02','M', 'N',:START_DATE, :END_DATE)category_A_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('B', '02','M', 'N',:START_DATE, :END_DATE)category_B_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('C', '02','M', 'N',:START_DATE, :END_DATE)category_C_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('D', '02','M', 'N',:START_DATE, :END_DATE)category_D_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('E', '02','M', 'N',:START_DATE, :END_DATE)category_E_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('F', '02','M', 'N',:START_DATE, :END_DATE)category_F_training
    , apps.xxhr_fsc_training_info.xxhr_fsc_training ('G', '02','M', 'N',:START_DATE, :END_DATE)category_G_training
    from dual
    Edited by: iandekoker on Jun 8, 2009 9:34 PM

    Rod
    I have a request. The request is based on various emails written about passing parameters in Discoverer Admin/Desktop. Now if you are experienced and work with set copntext on regular basis then it should be a walk in the park. However if you are new to it like me, then it seems a daunting task. So my request is: Can't you provide us with an example of how to complete the whole process from begin to end using an actual example? I will kick off the process and maybe you can add where i left something out?
    Example:
    SELECT ENAME, HIRE_DATE
    FROM EMP
    WHERE HIRE_DATE = :IDATE;
    We want to run this select statement in Discoverer Admin, but Admin does not like the :IDATE bind variable. So now we are gonna use SET CONTEXT to find a solution to our problem.
    Step1:
    First we have to create a context namespace in the database for the Discoverer contexts. Here is the code to create the context. It is okay to also named your function EUL_DISCO as this name would work perfectly for almost everyone. Best is to do all of this in the Apps schema. Copy and paste this code in Toad and F9 it. It should compile successfully
    CREATE OR REPLACE CONTEXT eul_disco
    USING apps.eul_disco;
    Step 2:
    Now you need to create a package to enable you to set and retrieve contexts from in Discoverer. Here is the code to create the package and package body. Just copy and paste the code into Toad and F9 (execute) it to create the package.
    --Package Spec
    CREATE OR REPLACE PACKAGE eul_disco AS
    FUNCTION set_context(p_name VARCHAR2, p_value VARCHAR2) RETURN VARCHAR2;
    FUNCTION show_context(p_name VARCHAR2) RETURN VARCHAR2;
    END eul_disco;
    --Package Body
    CREATE OR REPLACE PACKAGE BODY eul_disco IS
    FUNCTION set_context(p_name VARCHAR2, p_value VARCHAR2)
    RETURN VARCHAR2 AS
    BEGIN
    dbms_session.set_context('EUL_DISCO', p_name, p_value);
    RETURN p_value;
    END set_context;
    FUNCTION show_context(p_name VARCHAR2)
    RETURN VARCHAR2 IS
    BEGIN
    RETURN SYS_CONTEXT('EUL_DISCO', p_name);
    END show_context;
    END eul_disco;
    Step3:
    Once you have created this package successfully you need to log into Discoverer Admin. Then use the menu to navigate to Tools > Register PL/SQL Function. A window called 'PL/SQL Functions' will appear. Select the 'Import...' button. A new window called 'Import PL/SQL functions' will appear. Scroll down until you see set_context function. Once you found it click OK to import it to End User Layer. Do the same to import show_context function. Remember there are two functions and you need to import them both. When you are done, click 'Apply' button. Then click 'OK' button. You can double check to make sure your functions have been imported. Just nagivate to Tools > Register PL/SQL function again. When the window 'PL/SQL Functions' appears your function(s) should be in the list on the left hand site. Scroll down untill you find them.
    Step4:
    Now it is time to set your session parameters in a separate worksheet inside Discovere Desktop from your main reports. The following steps show you how to create a worksheet to define an effective date parameter. The parameter worksheet should be based on a folder that always returns exactly one row.
    Log into Discoverer Admin. Open the Business Area you want to use. Then create "New Custom Folder..."
    Copy and paste this code (select sydate from dual) inside the New Custom Folder and validate the code. Also rename your folder to 'Set Context Folder'
    Step 5
    Next log into Discoverer Desktop and choose 'Create New Workbook'. Then choose table layout option. In the available list choose 'Set Context Folder'. When you have highlighted 'Set Context Folder' click on '>' button. Then click then 'Finish' button. Once the workbook is created you will see 1 column called Sysdate and a row with today's date in it. Save this workbook and name this workbook XYZ. You might even rename the sheet to QWE.
    Step 6:
    Still in Desktop working on XYZ workbook on QWE sheet, click on Tools > Parameters > New. In the 'Name' field enter START_DATE. Next leave 'Create condition with operator' box unticked. Next in 'Prompt' field enter START_DATE. In 'Description' field enter START_DATE. In 'Default' field enter NULL. Click OK button when you are done.
    Step 7:
    Still in Desktop working on XYZ workbook on QWE sheet, click on Tools > Calculation > New. Click on 'Functions' radio button. Then click on 'Database' folder to expand it. Scroll down till you see 'Set Context' function in the list. Select it and click 'paste >>' button. It will now show: SET_CONTEXT(P_NAME, P_VALUE). Now you need to replace the two parameters (P_NAME, P_VALUE) of the function. Replace P_NAME with 'START_DATE'. When you are done click on Items radio button. Then click on the Parameters folder and select Start_Date.
    When you are done it should look like this: SET_CONTEXT('START_DATE',TO_CHAR(:START_DATE))
    You might want to rename this calculation to START_DATE
    Ps. If you need to create two date parameters START_DATE and END_DATE then you repeat step 7 cause you need one more calculation.
    Just replace START_DATE with END_DATE. You also might want to call this second calculation END_DATE. Thus when you are done you will have 2 calculations:
    SET_CONTEXT('START_DATE',TO_CHAR(:START_DATE))
    SET_CONTEXT('END_DATE',TO_CHAR(:END_DATE))
    This is useful when you want date parameters similar to: 'where date between :Start_date and :End_date'
    Step 8:
    When you now run the XYZ workbook (QWE sheet) it will prompt you for an START_DATE. Enter 10-Jun-2009 (make sure the format you enter the date is similar to the format you have set up in discoverer). Now your XYZ workbook have 2 columns. First column is still called Sysdate with today's date. The second column is called START_DATE with 10-JUN-2009 in it.
    Step 9:
    Now you want to remove the 'SELECT SYSDATE FROM DUAL' data stored in 'SET CONTEXT FOLDER' from your XYZ workbook (QWE sheet) as you no longer need that. Still working with Desktop inside XYZ workbook on QWE sheet > click on Sheet menu option > then Edit Sheet option. On the Select Items tab click on 'Set Context Folder' and click < button to remove the folder from workbook XYZ. Click OK when done and run the workbook XYZ (sheet QWE) again. Now the workbook XYZ (sheet QWE) should only have one column called START_DATE and 10-Jun-2009 as the only row.
    Step 10:
    Rob you might want to come in here. It is also useful to create another calculation retrieving the value of the parameter, so that the value entered for the parameter can be seen when the workbook is run. Please give step by step instruction to complete this process
    Step 11:
    Still remember your initial problem where we wanted to use :IDATE in Discoverer Admin folder, but Discoverer Admin did not like the :IDATE syntax?
    SELECT ENAME, HIRE_DATE
    FROM EMP
    WHERE HIRE_DATE = :IDATE;
    Solution:
    Well now you just replace :IDATE with TO_DATE(SYS_CONTEXT('EUL_DISCO','START_DATE'))
    Log into Discoverer Admin. Open your Business Area. Then create 'New Custom Folder..'.
    Copy the code below and paste it into the new custom folder.
    Then validate the code.
    Rename the new custom folder to 'Solution'
    --copy and paste this code into folder 'Solution'
    SELECT ENAME, HIRE_DATE
    FROM EMP
    WHERE HIRE_DATE = TO_DATE(SYS_CONTEXT('EUL_DISCO','START_DATE'))
    note: 'EUL_DISCO' is the name of the context and package you created in step1
    : 'START_DATE' is the name of the calculation you did in step7
    Then log onto Discoverer Desktop > open your workbook XYZ > open sheet QWE.
    Click on Menu item called Sheet > New Sheet > choose Table layout > click next > scroll down available folders till you find SQL folder with then name 'Solution'. Select 'Solution' folder and click > then click Finish.
    The folder named 'Solution' will be used to populate the newly created sheet with data. You might want to rename the newly created sheet to 'Finally'.
    At this point workbook XYZ should have 2 sheets (QWE and Finally).
    Sheet 'QWE' contains the parameter and nothing else.
    Sheet 'Finally' displays the code found in folder 'Solution'
    First you run sheet QWE to set parameter. When prompt for a date enter '10-JUN-2009'. Click OK button.
    Then click on sheet 'Finally' to allow the parameter to take effect and do its job. You will see that only data true of 10-JUN-2009 are displayed
    Notes:
    This is a very simple example. But if you work thru this example, then you will get the concept behind the idea and would you be able to satisfy your own need.

  • Extract the "bind" variables for a given query running in 10g.

    how can we extract the "bind" variables for a given query running in 10g? The performance of a query may vary based on the parameters supplied to it. For example, a query like the following
    SELECT * FROM CUSTOMER_ORDERS WHERE CUSTOMER = :CUST_ID
    .might run differently when the :CUST_ID is "123" who may have very few orders versus "456" who may have tens of thousands of orders.
    So, if we see a spike in the system due to a query, we need visibility into what the exact query syntax and values are for any database session. We're aware of an Oracle view called V$SQL_BIND_CAPTURE, but what we're finding with this view is that it's only a snapshot of variables that are refreshed on an interval. That view does not give us a live view into what values are being used in the various sessions in realtime.
    If someone ould provide us with some SQL (or other means) to do get a realtime view into the SQL and variables currently running in the database, it would be greatly appreciated.

    In addition to what's been said in the other thread, you could add a layer of logging either in the database or out.
    v$sql_bind_capture and the associated ash view dba_hist_sqlbind contain sample data.
    You could up the sample rate but it's not advisable - it's still just a sample.
    If you're on 11g, this is where adaptive cursor sharing might help.
    Not help in finding the values of your binds, but help in using different plans where there is such a skew for different bind values and the plan is perhaps wrong for customer 456.
    The problem when you're got such a skew and you're using bind variables is that the two don't really go together.
    When the query is next parsed and you've got bind variable peeking enabled, you might get the 123 plan is that is the bind value at parse time and then run into problems for 456 or even vice versa.
    See http://jonathanlewis.wordpress.com/2009/05/06/philosophy-1/ for a discussion on binds and histograms which reflects the reasons for using either.

Maybe you are looking for