read the value of the variable binding

Hello

I was debugging a java application and in the process, I wanted to know what values the request as a bind variable. So, I checked v$ sql_bind_capture and activated the trace on the session. Unfortunately the data type is TIMESTAMP, so the view did not show a value and I got the trace was a memory dump that is not helpful for me:
 Bind#1
  oacdty=180 mxl=11(11) mxlc=00 mal=00 scl=00 pre=00
  oacflg=03 fl2=1000000 frm=01 csi=873 siz=0 off=24
  kxsbbbfp=fffffd7ffdb6fbd0  bln=11  avl=07  flg=01
  value=
Dump of memory from 0xFFFFFD7FFDB6FBD0 to 0xFFFFFD7FFDB6FBD7
FFFFFD7FFDB6FBD0 0D0B6C78 00010101                    [xl......]
Is there a function/method to convert a timestamp or at least vice versa?

Just run this little test:

SQL> CREATE TABLE t (c1 TIMESTAMP);

Table created.

SQL> INSERT INTO t VALUES (TRUNC(SYSTIMESTAMP));

1 row created.

SQL> COMMIT;

Commit complete.

SQL> SELECT TO_CHAR(c1) FROM t
  2  UNION
  3  SELECT DUMP(c1) FROM t;

TO_CHAR(C1)
--------------------------------------------------------------------------------
13-NOV-08 00.00.00.000000
Typ=180 Len=7: 120,108,11,13,1,1,1

Convert decimal to hex you gives 78, 6 C, 0, 0 D, 01, 01, 01 what byte order accountant reverse is the same as your memory dump. So I think the bind value is 00:00:00:000000 November 13, 2008.

Not very well how to recover of the hexagon directly at the time, but I do not know someone knows!

In fact, Google has been very helpful... take 100 on the first two decimal values: 120-100 = 20; 108-100 = 08, to give you the year: 2008. Then 11 and 13 are the month and day. The rest is hour + 1 minute + 1, the second + 1. So just convert your hex decimal and you should be able to discern the value!

Published by: Mike Pargeter 13 November 2008 16:54

Tags: Database

Similar Questions

  • Execution plan will change if I use the variable binding instead of the literal value?

    Hi guys,.

    Suppose I have a select "... Of... WHERE ID = 2 and... "if I go to use the variable binding instead of the literal value 2," SELECT... " Of... WHERE ID =: p_id and... ", the execution plan change?
    I test multiple statements, the plan does not change, but I don't know if it would even as well as in some other cases.
    Someone at - it ideas?

    Thank you very much.

    Anneso wrote:
    Hi, sorry for the unclear post, it's 11 GR 2.

    As Sybrand already mentioned, there are a lot of change that came in the implementation of the bind variable in some versions of Oracle db. Since you're on 112, it is still true with the introduction of Adaptive Cursor Sharing . Please have a read on it since the post below written by the development of Oracle optimizer group.
    http://blogs.Oracle.com/optimizer/entry/why_are_there_more_cursors_in_11g_for_my_query_containing_bind_variables_1

    Aman...

  • Use sessionScope as the value of the Variable binding

    Dear all,

    I have a variable in sessionScope, and I want to use it as a condition of application of a ViewObject.

    I found a thread talking about, there's only one: (Re: set the value in the global variable. )
    How to use the value in the scope of session groovy script?

    Model project:
    Set variable in the scope of the session:
    ADFContext.getCurrent () .getSessionScope () .put ("Empno", empno);

    Getting value of session scope:
    Object empno is ADFContext.getCurrent () .getSessionScope () .get ("Empno");.

    ViewProject:
    Set variable in the scope of the session:
    FacesContext.getCurrentInstance () .getExternalContext () .getSessionMap () .put ("Empno", empno);

    Getting value of session scope:
    Object empno is FacesContext.getCurrentInstance () .getExternalContext () .getSessionMap () .get ("Empno");.

    Getting value of scope jspx page session
    #{sessionScope.Empno}

    Hi Samson,.

    Here are the groovy expression to access the value of the sessionscope:

    adf.context.sessionScope.role
    

    But, as the said John instead to access the session of the model can be a method of model (whether in AMImpl or voImpl) who takes the role as a parameter value and sets the value of the variable binding of the vo, then call this AM from the bean method passing the role value by getting the scope of the session.

    Jean Lou

  • How can I pass a value to a variable binding in a report query?

    I did a query of report to print a PDF report, with a dinamyc source query that has a connection variable, like this:

    SELECT EMPNO, EMPNAME, EMPDEPT

    FROM EMP

    WHERE EMPNO =: PARAMETER;

    I want to call the report print directly from a page, by using the url print showed by apex:

    f? p = & APP_ID.:0 : & SESSION. : PRINT_REPORT = MYREPORT

    How can I pass the value of the variable binding: PARAMETER using this URL?

    I don't think you can use the url parameter passes in a report query.

    the binding variable: PARAMETER must be a page element or an element of the application.

    use the "include session information and application" in the defination of report query to bind the value when the report is run

  • Setting value to a variable binding

    Binds the values of variables can be access with this:

    AttributeBinding deptBinding =
    (AttributeBinding) getBindings () .getControlBinding (bindName);
    Return deptBinding.getInputValue ();

    Can I set the value of a variable binding in the same way?

    To define a value of binding, I currently have access to the ViewObjectRowImpl and make a setVar (x) in order to get, but it's very hard. I would like a more direct via liaison system if possible.

    Yes you can set it as

    AttributeBinding attr = (AttributeBinding) bindings.getControlBinding ("test");
    attr.setInputValue ("test");

  • How to set the value of the variable bind in VO on page load?

    Hello, I use JDeveloper 11.1.2.3.0.

    I created a VO in my application that uses a variable binding in the where clause. I want to put the value of this variable on the loading of the page automatically.

    I read that I can do this through setNamedWhereClauseParam()... but I can't find out where and how to use it.

    Can anyone help please?

    You can put in different places:

    AppModuleImpl,

    ViewObjectImpl,

    ViewRowImpl

    Just him export the customer interface and use whenever you want

  • declare the variable binding

    I do homework here and ran into the wrong hope that someone here can help

    1. I thought that I understand the conscept of variable binding (which I think it is the same concept as the pointer in C/C++ programming), is that correct?

    2. I write the code and find the problem below, please point out what I did wrong?


    SQL & gt; describe the plants
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    PLANTID NOT NULL NUMBER (5)
    COMMONNAME NOT NULL VARCHAR2 (30)
    LIKE NOT NULL VARCHAR2 (30)
    SPECIES NOT NULL VARCHAR2 (30)
    FLOWERCOLOR VARCHAR2 (10)
    HEIGHT NUMBER (4.1)
    DATE OF ACQUIREDDATE
    LISTPRICE NUMBER (6.2)




    SQL & gt;
    declare


    bv_color variable varchar2 (10);
    v_price plants.listprice%Type;



    cursor cur_color is
    Select distinct lower (flowercolor) color
    plants;



    Start


    for rec_color looping cur_color

    : bv_color: = rec_color.color;



    Select avg (listprice)
    in v_price
    plants
    where lower (flowercolor) =: bv_color;



    dbms_output.put_line)
    "The average price for our plants with ' |: bv_color |"
    "flowers is $' | Round(v_price,2) | '.');
    dbms_output.put_line ('thank you');



    end loop;



    exception
    while others then
    dbms_output.put_line (' my exception:' | sqlcode |)
    ' : ' || SQLERRM);
    end;
    /
    SP2-0552: Bind "BV_COLOR" variable not declared.

    This is the way of declaring bind variables in SQL * more.

    In a PL/SQL block, you do not use bind variables like SQL * more. You just use normal variables. The PL/SQL engine is smart and sends SQL statements to the SQL engine containing all PL/SQL variables converted to bind variables. If it works transparent in PL/SQL and you don't have to do something more.

    Kind regards
    Rob.

  • ADF where can I set the variable binding VO?

    I created VO with bind variable 'BPM_USER_NAME '.

    In VOImpl.java I have getter and setter:

    public void setBPM_USER_NAME (String value) {}

    ensureVariableManager () .setVariableValue ("BPM_USER_NAME", value);

    }

    I plugged my .jspx to BephorePhase - #{pageFlowScope.SimpleBean.beforePhase}

    My SimpleBean.java beforePhaseof the method:

    Public Sub beforePhase (PhaseEvent phaseEvent) throws SQLException {}

    If (phaseEvent.getPhaseId () == PhaseId.RENDER_RESPONSE) {}

    Logger.Warning ("InventoryIlliquid - BeforePhase");

    FacesContext fctx = FacesContext.getCurrentInstance ();

    AdfFacesContext = AdfFacesContext

    AdfFacesContext.getCurrentInstance ();

    Boolean isInitialRequest =! adfFacesContext.isPartialRequest (fctx);

    If {(isInitialRequest)

    OnLoad();

    System.out.println ("InventoryIlliquid - onload");

    }

    else System.out.println ("InventoryIlliquid - NO onload");

    }

    }

    public void onload() {}

    Nobody PersonIdVOImpl = new PersonIdVOImpl();

    person.setBPM_USER_NAME ("user");

    }

    I won't set my ' BPM_USER_NAME 'user' and after that my form will open see results. " Where should I write my code?

    What is the error you get?

    Are you viewCriteria assistance or a variable base of bind query?

    and do not write like this

    PersonIdVOImpl p = new PersonIdVOImpl(); / / use this. getPersonIdVo();

    p.setbpm_user_name ("username");

  • using the variable binding

    drop table tab purge;
    create table tab (number x, y varchar2 (5));
    Insert tab values(1,'rr');
    Insert tab values(2,'rr');
    Insert tab values(3,'rr');
    Insert tab values(4,'rr');
    commit;
    create or replace PROCEDURE get_data (p_data ON SYS_REFCURSOR,
    P_ID IN varchar2)
    is
    sql_str varchar2 (100): = ' SELECT * FROM tab WHERE. X IN (: x)';
    Start
    Open p_data
    for sql_str
    using p_id;
    end;
    /

    SET SERVEROUTPUT ON

    VAR A REFCURSOR
    VAR B VARCHAR2 (1000)

    EXEC get_data (: one, '3', 4);

    PRINT

    following error, so that the value of product produced no arrow.
    -------------------------
    ERROR:
    ORA-01722: invalid number
    -------------------------

    Here the implicit conversion does not work, and '3.4' is considered a stgring rather 2 separate values. I have to have to use bind variable and do not want to use dbms_sql. Is it possible, '3,4' is taken as 2-digit values, rather a string value helps Pl, thanks.

    You cannot use list as a bind variable. Use:

    SQL> create or replace PROCEDURE get_data (p_data IN OUT SYS_REFCURSOR,
      2  p_id IN varchar2)
      3  is
      4  sql_str varchar2(100) := 'SELECT * FROM tab WHERE tab.X IN (' || p_id || ')';
      5  begin
      6  open p_data
      7  for sql_str;
      8  end;
      9  /
    
    Procedure created.
    
    SQL> SET SERVEROUTPUT ON
    SQL>
    SQL> VAR A REFCURSOR
    SQL> VAR B VARCHAR2(1000)
    SQL>
    SQL> EXEC get_data(:A, '3,4');
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL> PRINT A
    
             X Y
    ---------- -----
             3 rr
             4 rr
    
    SQL> 
    

    Or, if you want to use bind variable, use the composite type. Something like:

    SQL> create or replace
      2    type NumberList
      3      as table of number
      4  /
    
    Type created.
    
    SQL> create or replace PROCEDURE get_data (p_data IN OUT SYS_REFCURSOR,
      2  p_id IN NumberList)
      3  is
      4  sql_str varchar2(100) := 'SELECT * FROM tab WHERE tab.X member of :x';
      5  begin
      6  open p_data
      7  for sql_str
      8  using p_id;
      9  end;
     10  /
    
    Procedure created.
    
    SQL> SET SERVEROUTPUT ON
    SQL>
    SQL> VAR A REFCURSOR
    SQL> VAR B VARCHAR2(1000)
    SQL>
    SQL> EXEC get_data(:A, NumberList(3,4));
    
    PL/SQL procedure successfully completed.
    
    SQL> PRINT A
    
             X Y
    ---------- -----
             3 rr
             4 rr
    
    SQL> 
    

    SY.

  • $a_report to refresh a report, but it is not picking up the variable binding

    Hello

    APEX - Express 4.1.0 Application
    Browsers - all
    Database - 11g 2

    I have a tree on a page region. When a user clicks on a leaf of the tree, I want to be able to use the ID to refresh a report in a different region on the same page

    Code for when the user clicks on the map

    $('div.tree_li_a').click (function() {}

    node_id = $(this).parents('li:first').attr ('id');

    If (node_id.substr (0, node_id.indexOf('|')) == 'Y')
    {
    $s ('P4_SELECTED_VALUE', node_id.substr (node_id.indexOf('|') + 1));
    Alert ("value: ' + $v ('P4_SELECTED_VALUE')");
    $a_report ('28576803999973770 ',' 1','20 ', ' 20');
    $a_report ($v ('P4_REPORT_ID'), '1','20 ', ' 20');
    };
    });

    SQL statement

    SELECT *.
    PRODS p WHERE PROD_CODE =: P4_SELECTED_VALUE

    The problem I have is that when the report is run (I know it's refreshing) the P4_SELECTED_VALUE of the link variable is null.

    Pop alert contains the correct value, and when I do the visible P4_SELECTED_VALUE it also contains the value?

    Any help is very appreciated

    Rob

    Rob,

    You insert P4_SELECTED_VALUE value in the APEX session before refreshing the report.

    Add following the JS function in your page

    //insert value into session using JS
    
    function fnSetSessionState(pItem, pValue) {
        var vAjaxDummy = new htmldb_Get(null, $v('pFlowId'), null, 0);
        vAjaxDummy.add(pItem, pValue);
        var vDummy = vAjaxDummy.get();
        vAjaxDummy = null;
    }
    

    and your code...

    $('div.tree li a').click( function() {
    
    node_id = $(this).parents('li:first').attr('id');
    
    if (node_id.substr(0,node_id.indexOf('|')) == 'Y')
    {
    $s('P4_SELECTED_VALUE',node_id.substr(node_id.indexOf('|')+1));
    alert('Value Set: ' + $v('P4_SELECTED_VALUE'));
    fnSetSessionState('P4_SELECTED_VALUE',$v('P4_SELECTED_VALUE'));
    //$a_report('28576803999973770','1','20','20');
    $a_report($v('P4_REPORT_ID'),'1','20','20');
    };
    });
    

    That's how I used the version 3.2 or earlier. But now I prefer to use declarative dynamic actions...

    Kind regards
    Hari

  • [ORACLE 9] OPEN for the variable binding USING declaration

    Hello

    I have a loop that retrieves only 1 sheet instead of 7:
    DECLARE
    
     lv_into varchar2(40);
     lv_qry  varchar2(400);
     
     type curtest_ref is ref cursor;
     
     curtest          curtest_ref;
     lv_compteur number(4) := 1;
     
     lv_client_loc   varchar2(100);
     BEGIN
     dbms_output.put_line( 'Début' );
     lv_qry := 'select client_loc from tmp_jbm where client_id = :A ';
     
     open curtest for lv_qry using lv_compteur;                 
     loop
                    fetch curtest into lv_client_loc ;
                    exit when curtest%notfound;
                    dbms_output.put_line( 'ligne: '       || to_char( lv_compteur )
                                       || ' Client Loc: ' || lv_client_loc );
                    lv_compteur := lv_compteur + 1;
                    exit when lv_compteur > 6;
         end loop;
    EXCEPTION
        when others then
                 dbms_output.put_line( 'Erreur exception: ' || sqlerrm );
    END; 
    [/END CODE]
    
    It looks like the cursor only fetches 1 record and then stops.
    
    Many thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Bind variables are evaluated when the cursor is opened. Not when extract you the data.
    I don't know why you use dynamic sql, here, you do not need.
    In any case, your code is incorrect.
    Assuming that the client_id is unique, Yes, your fetch fetch one line. When you loop the second time, retrieving a new record for the same statement, then you hit no_data_found.

    ---------
    Sybrand Bakker
    Senior Oracle DBA

  • ViewObject accesses the variable binding a sessionScope setting?

    Hello

    using the Fusion of ADF Jdev11g request
    ViewObject get a sessionScope parameter and set in the binding variable? without the help of executeWithParameter

    Thank you
    greenApple

    N °

    You must call a method in the model layer and pass the parameter.

    Timo

  • How to get the value of a variable to bind a client method of the AM?

    Hello

    I have a VO based on a variable binding. This binding variable is associated with an element on the page. When the user fills the element that the binding variable is written, the query is executed. This method works.
    What I want now is the following. With a second button, the user runs an exported AOS action method. In this method, I want to get the value of the binding variable that has been put forward.
    How would I do that?

    You can get the variables bind currently set on the object view as follows:
    catServiceDurationsVO has the reference to the VO
    VariableValueManager vm = null;
    VM = catServiceDurationsVO.ensureVariableManager ();
    System.out.println (VM.getVariableValue ("BindVariable"));

    Thank you
    Nini

  • BIND THE VARIABLE INSIDE A LOOP

    Hello
    I have question about the sort of the values using Plsql... My requirement is to get values of N with the user and sorting in ascending or descending order. I tried the following query

    DECLARE
    Is of type TABLE numsort
    NUMBER
    INDEX OF DIRECTORY;
    v_num numsort;
    number of v_total;
    number of v_no;
    BEGIN
    -get the number of values to sort
    v_total: =: TotalNum;
    dbms_output.put_line (v_total);
    because me in 1.v_total
    LOOP
    v_no: =: none; -Read the values
    v_num (i): = v_no;
    dbms_output.put_line (v_num (i): 10;)
    END LOOP;
    END;

    its code is not complete... sound to read the value in the table... Read itself does not

    The problem is that the connection variable is not reset with each iteration. I am using Toad and he asked me to pass all the variable binding both... But I want to read the values in the table with each iteration. Is it possible in PLSQL... or is there another way to do this...

    hope you are clear with the requirement... If any infomartion extra need please come bk...

    Waiting for your replay

    Thanks and greetings
    Rognard

    Maybe like this?

    SQL> create or replace procedure test_proc (p_input varchar2, p_separator varchar2) is
      2  v_input varchar2(32767):= p_input||p_separator;
      3  begin
      4  if p_input is not null then
      5  while instr(v_input,p_separator) > 0 loop
      6      dbms_output.put_line(substr(v_input,1,instr(v_input,p_separator)-1));
      7      v_input:=substr(v_input,instr(v_input,p_separator)+1);
      8  end loop;
      9  end if;
     10  end;
     11  /
    
    Procedure created.
    
    SQL> exec test_proc('10, 4, 6, 3',',')
    10
    4
    6
    3
    
    PL/SQL procedure successfully completed.
    
    SQL> exec test_proc('',',')
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    Nicolas.

  • How many times can I use a variable binding in a query of the VO?

    Is it possible that I can use a variable binding in a query of VO just once?

    I test a query that keeps throwing the Houston-27122 error by pressing the application module tester. I tried to limit the problem to the simplest possible case, and it seems that the error is caused by the fact that I use the same variable bind two or more times.

    When the query looks like this:

    query1.png

    I have run, enter 'x' and it returns me the result.

    When I change to:

    query2.png

    I have run, enter the value

    param.png

    and immediately get the error

    error.png

    The same thing in sqlplus runs without problem:

    sqlplus.png

    My version of JDev is build JDEVADF_11.1.1.9.0_GENERIC_150314.0718.6673

    Please, advise.

    P. S. where can I find documentation queries are supported in your? In particular, I'm interested if I can use WITH the clause. There seems to be some confusion on this matter (see, for example, Oracle SQL WITH clause support - JDeveloper and ADF)

    Thank you.

    It depends on:

    Open your VO in JDev and go the the query page.

    In the lower part, there is a drop down 'link type', it is usually set to "JDBC-positional. In this case, you will need to provide the bind value for each occurrence of the variable binding separately.

    You could change that to "named" (don't remember the exact name). But beware, this will also affect all relatioships master retail to others your. I think that this is not a good idea to change the style of binding to a single VO.

    Good bye

    DPT

Maybe you are looking for

  • Why the spellchecker of Firefox fixes in Spanish instead of English?

    Firefox fixes in Spanish if current browser and Op system is set to English. I tried English installation as an add-on dictionary and it gives me a message "cannot install update in this version of Firefox 3.6.3. It was a recent download of firefox.

  • Sync iphone with itunes

    My iphone will not sync with my itunes. this is the message that I receive. I checked and the latest version of itunes is installed on my macbook and my phone. Help!

  • P1102w needs network installation. INF file

    I am trying to connect to a P1102w printer installed on a network and add the printer function States it needs some. INF file. The printer is shared on a Vista computer and connected via USB. I was not able to get wireless to work somehow. Ray Titus

  • Automatically disable Touchpad when a mouse is connected

    I just got a new! 7 R3 to replace an older laptop Alienware.  My old laptop there is a checkbox on the button options that will deactivate automatically the touch pad when a mouse is connected and turn on automatically when the mouse has been disconn

  • Print questions after the custom section changes using a printed code

    HelloWe have problems with the order of the custom section. Please find below bottom1. we have a custom code to print sections customized specification associated with the material specifications2 this custom code developed 2.5 years ago and absolute