Error in the bind variable!!

Hi all,
I have the following quiery in my report
SQL> ed
Wrote file afiedt.buf
  1* select add_months(to_date('30-apr-07') , rownum- 1) i from all_objects where rownum < 5
SQL> /
I
30-APR-07
31-MAY-07
30-JUN-07
31-JUL-07Now I wrote a finction in the group as
function CF_bFormula return Number is
b number(17, 3);
begin
select t.B_VAL into b from test6152 t where to_date(t.i_date, 'dd-mon-yy') = to_date(:i, 'dd-mon-yy'); 
return (b);
end;The this function is giving me an error. ORA-01403 No data found
Can anyone point out the error.
The structure of the TEST6152 table is like this
SQL> select * from test6152;
I_DATE    CUR      B_VAL      C_VAL
30-APR-07 USD         20         30
31-MAY-07 USD         50         10
30-JUN-07 USD         25         18
31-JUL-07 USD         13         12Im quite confused beacuse this quiery gives me the correct output
SQL> ed
Wrote file afiedt.buf
  1  select t.B_VAL  from test6152 t,
  2  (select    add_months(to_date('30-apr-07') , rownum- 1) i from all_objects where rownum < 5) L
  3* WHERE to_date(t.i_date, 'dd-mon-yy') = to_date(I, 'dd-mon-yy')
SQL> /
     B_VAL
        20
        50
        25
        13Thanks in advance

Today I restart my comp and run the report and ....Woah!
It runs without ant error!!!
I wonder what went wrong yesterday!

Similar Messages

  • How to use the bind variable in custom.pll

    Hi,
    How to use the bind variable in custom.pll.Its through error.
    any one gem me.
    very urgent.
    M.Soundrapandian.

    Hello,
    Please, ask this kind of questions in the e-business forum.
    Francois

  • Got an error while creating bind variables using sql database.

    iam going to use sql database for ADF-BC .
    i created the bind variable and apply the bind position for the corresponding variable in the view object editor.when i click test it shows me "query is valid". when i tried to run that it gives me two errors.
    1) sql error during statement preparation.(ie) select empid ,empname......from the emptable where empid like :'emp' and
    2) [Microsoft][SQl server  2000 driver  for jDBC] invalid parameter bindings
    i need help to know the solution for this...(or) is there any other way to create bind variable ......

    The 3 binding styles supported by JDev:
    Oracle Named - ie. SELECT xxxx FROM xxxx WHERE emp_id = :vEmp (note colon and variable name)
    Oracle Positional - ie SELECT xxxx FROM xxxx WHERE emp_id = :1 (note colon)
    JDBC Positional - ie SELECT xxxx FROM xxxx WHERE emp_id = ?
    Literally this query is sent to the database to execute, then the bind variables values are applied as a separate database operation. If SQL Server doesn't suport any of these binding styles, it's not going to work. As Chris Noonan suggests, try the JDBC Positional style though as you're using a JDBC driver to connect to SQL Server and it should support that style (the others are Oracle styles), and make sure you've switched the binding style on the VO query page to "JDBC Positional" too.
    You must also on the VO bind variable page define your bind variables.
    Also read the 10.1.3 JDev guide on ADF Business Components and View Object bind variables.
    CM.

  • How to pass the bind variable value to the sql statement of the LOV

    Hi,
    I am using Forms 10g builder.
    I have a text item which will be populated by a LOV when i press a button, but i have a bind variable in the SQL statement of the LOV. That bind variable should be replaced by a value which is derived from a radio group in the same data block.
    For Ex: ( )radio1 ( )radio2
    before i click on the push button, I'll select one of the radio button above,so my question is how to assign this radio group value to the bind variable in the sql statement in the LOV?
    Pl any hint is appreciated!
    Thanks
    Reddy

    The variable can be taken into account in the SELECT order contained in the Record Group used by the LOV.
    e.g. Select ... From ... Where column = :block.radio_group ...Francois

  • How to assign sessionscope variable to the bind variable in Query of VO

    Hi all,
    I want to know how to assign a sessionscope variable in the binvariable of Query in VO
    My sessionscope variable holds the value of currently selected column in the table. eg:empname of the currently selected column which is in empdetails table...
    I want display the schemes available for the selected employee in the next table..The schemes are in another table named empschemes which has the empname and empschemes as column
    I have created a vo for empschemes table with bind variable 'scheme_bind'..I need to set the sessionscope variable '#{sessionScope.empname}" to the bind variable.
    Its urgent,..Pls do reply asap
    Thanks in advance
    Nasrin

    HI,
    You can use
    adf.context.sessionScope.get("YourSessionVariable")this code for assigning VO's bind variable value.write this code where you create bind variable and do not forget click on expression radio button.
    Rafat

  • Accessing the binding variables

    Hi,
    i have the following attribute entry in the page definition file.
    <attributeValues IterBinding="RenewalPolicyTermVOIterator" id="PolicyNum">
    <AttrNames>
    <Item Value="PolicyNum"/>
    </AttrNames>
    </attributeValues>
    I am getting Null Pointer exception at the 2nd line if I access the binding variable in the managed bean.
    1. AttributeBinding policyNumBinding = (AttributeBinding)(getBindings().getCtrlBinding("PolicyNum"));
    2. Number policyNum = (Number)policyNumBinding.getInputValue();
    3. System.out.println("PolicyNum from bindings" + policyNum);
    But the following code is getting the actual value of the binding attribute. But in the import stements I am getting a message JUCtrlAttrsBinding is an internal API and cannot be used.
    JUCtrlAttrsBinding policyNumBinding2 = (JUCtrlAttrsBinding)getBindings().get("PolicyNum");
    Number policyNum2 = (Number)policyNumBinding2.getInputValue();
    System.out.println("PolicyNum from bindings" + policyNum2);
    Why is the above code failing to get the binding attribute. What is the best way to refer the attribute in the managed bean code

    Why do you need all AttributeBinding class ... when you bind the input text in UI
    In Backingbean class a private variable is created
    private RichInputText rowOPsIT;
    and
    public void setRowOPsIT(RichInputText rowOPsIT) {
    this.rowOPsIT = rowOPsIT;
    public RichInputText getRowOPsIT() {
    return rowOPsIT;
    You can use the variable or functions to get the value and value properties

  • How to set the bind variable on page load and execute query ?

    Hi All,
    I am using Jdeveloper 11.1.1.5
    I have a table called "Employee"
    Columns :- id , name , location
    Data :- 1, ,james , chicago
    2 ,Raj ,capetown
    Now i have another webservice(created as a webservice dataControl) which sends me the "id" on each time my page loads.Now the id which has been returned by webservice should be incorporated in my VO Query as in where clause to fetch the data for the respective "id" in that "Employee" table and should be rendered on form.
    Eg :- Id "2" has been sent by the webservice then the record should be fetched from database should be "2","raj","capetown".
    I know that there would be necessity of bind variable , but how do i set the bind variable on page load ?
    How can i use the bind variable appropriately ??
    Please suggest !!!!
    Thanks.

    Hi,
    Check
    http://www.orastudy.com/oradoc/selfstu/fusion/web.1111/b31974/web_services.htm#CJADCDBG
    http://thepeninsulasedge.com/frank_nimphius/2011/02/18/adf-code-corner-sample-73-released-hands-on-creating-a-search-form-using-a-pojo-ws-and-the-web-service-data-control/
    -Suresh

  • 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.

  • How to have the BIND variables value using the TKPROF utility.

    WE have a JAVA application and Oracle 9i database.We need to figure out what all select/update/insert sql staements are firing if i am doing one complete processing in my JAVA front application.
    Initally I have planned for using TKPROF utility after makeing AUTO_TRCE=TRUE in the database.But the problem is that all select/insert/update sql statements are using the BIND variables in the JAVA code and same is coming/printing on the trace file also.
    can we print out the BIND variables values also,while making the TRACE ON?
    eg: trace is generaitng the all insert statements like below.
    insert into TEST(Column1,Column2) values(:1,:2);
    I want to know the value of :1 and :2 bind variables.
    If you have any cluse about it please let me know.
    Mitesh Shah

    Thanks Guys,
    I got the BIND variable values in the TRACE file.Previously i was searching on the OUtputfile.
    I am pasting the same trce file format.Can you please verify it.Is i am looking the correct file and corect location.
    PARSING IN CURSOR #2 len=1571 dep=0 uid=66 oct=3 lid=66 tim=18446744071740803342 hv=1462188955 ad='123434f0'
    SELECT PARENTIDKEY,CONTRACTKEY,COMPANYKEY,BACKENDKEY,DATAREP,BANKHOLDINGID,BANKID,CARRIERPARTYID,PRODUCTID,ID,PREMIUMINDEXRATE,ILLUSTRATEDMATURITYLOW,ILLUSTRATEDMATURITYHIGH,SPECIALHANDLING,CARRIERCOMMCODE,MONEYTRANSFERTYPE,FIRSTBILLSKIPMONTH,CONTESTABILITYENDDATE,DEDUCTIONDATE,MARKETVALADJUSTIND,FREEAVAILABLEAMT,ADVANCINGREJECTEDIND,RATEDIND,OTHERINSUREDIND,ENDORSEMENTIND,BENEFICIARYIND,CASECONTROLNUMBERASSUMING,OWNERLEGALNAME,STAMPDUTY,COMMISSIONANNUALIZEDIND,NONSTDCOMMTAKEN,LAPSETAXABLEGAIN,GOVTALLOTMENTSUSPENSEACCTAMT,LASTNOGOODCHECKREASON,LASTNOGOODCHECKDATE,LASTCOIDATE,LASTDEDUCTEDEXPENSECHARGES,LASTDEDUCTEDCOICHARGES,STATEMENTBASIS,LASTNOTICETYPE,LASTNOTICEDATE,PAYMENTDUEDATE,LASTBANKCHANGEDATE,EFTENDDATE,BANKBRANCHNAME,BANKNAME,PAYMENTDRAFTDAY,BANKACCTTYPE,CREDITCARDTYPE,CREDITCARDEXPDATE,ACCTHOLDERNAME,ROUTINGNUMBER,ACCOUNTNUMBER,PAYMENTMETHOD,ANNUALPAYMENTAMT,PAYMENTAMT,PAYMENTMODE,LASTCOIANNIVDATE,BILLINGSTOPDATE,BILLEDTODATE,FINALPAYMENTDATE,GRACEPERIODENDDATE,PAIDTODATE,STATUSCHANGEDATE,REINSTATEMENTDATE,TERMDATE,ISSUEDATE,EFFDATE,DOWNLOADDATE,DURATION,POLFEE,POLICYVALUE,COMMISSIONROLLOVERPCT,COMMISSIONOPTIONSELECTED,REPLACEMENTTYPE,CUSIPNUM,CONVERTTOPRIVATEIND,PORTABILITYIND,REINSURANCEIND,BILLNUMBER,JURISDICTION,ISSUETYPE,ISSUENATION,STATUSREASON,PRIORPOLICYSTATUS,POLICYSTATUS,SHORTNAME,ADMINISTERINGCARRIERCODE,PLANNAME,FILEDFORMNUMBER,FORMNO,CARRIERCODE,PRODUCTCODE,PRODUCTTYPE,LINEOFBUSINESS,CERTIFICATENO,POLNUMBER,CARRIERADMINSYSTEM FROM "POLICY" WHERE PARENTIDKEY = :1 AND CONTRACTKEY = :2 AND COMPANYKEY = :3 AND BACKENDKEY = :4
    END OF STMT
    PARSE #2:c=0,e=1298,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=18446744071740803336
    BINDS #2:
    bind 0: dty=1 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=01 oacfl2=0 size=4000 offset=0
    bfp=082a5a9c bln=4000 avl=09 flg=05
    value="Holding_1"
    bind 1: dty=1 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=01 oacfl2=0 size=4000 offset=0
    bfp=082a4af0 bln=4000 avl=10 flg=05
    value="DUL001138U"
    bind 2: dty=1 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=01 oacfl2=0 size=4000 offset=0
    bfp=069bb890 bln=4000 avl=02 flg=05
    value="00"
    bind 3: dty=1 mxl=4000(4000) mal=00 scl=00 pre=00 oacflg=01 oacfl2=0 size=4000 offset=0
    bfp=069ba8e4 bln=4000 avl=04 flg=05
    value="CLIF"
    **********************************************************************************

  • How to identify the bind variable peeking problem?

    How to identify the bind variable peeking problem whether my db hitting or not and how to resolve it?
    currently we are doing the dbms_stat of application schema's with gather auto option and i hope this option we take the histogram stats also. Is there any option to improve it and its highly transactions oltp env of 11g.

    What is your exact 4 digits Oracle version ?
    Bind peeking issues are supposed to be solved with adaptative cursor sharing in 11.1 and 11.2:
    11.1 http://download.oracle.com/docs/cd/B28359_01/server.111/b28274/optimops.htm#sthref919.
    11.2 http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/optimops.htm#PFGRF94588
    which says also:
    >
    Adaptive cursor sharing is enabled for the database by default and cannot be disabled. Note that adaptive cursor sharing does not apply to SQL statements containing more than 14 bind variables.
    >
    Edited by: P. Forstmann on 10 nov. 2011 13:50

  • 'Error 49 bad bind variable' error message.

    When I copied a form that has been working from our Linux server to my PC and compiled it, I received many error messages like this in several procedures, functions and triggers:
    “Error 49 at line 69, column 10, bad bind variable ‘edit_Dealer.corporation’
    Does anybody know why this is? As I said, the app works for the end user from the Linux server.
    Thank You.

    Does the form you copied have any attached libraries or subclassed objects? If so, did you copy the Library and Object source files to your PC as well? If you copied these supporting files already, are they in a directory location that is part of your FORMS_PATH?
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

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

    Hi
    APEX          -     Application Express 4.1.0
    Browsers     -     All
    Database     -     11g2
    I have a tree region on a page. When a user clicks 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 the leaf
    $('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'));
    //$a_report('28576803999973770','1','20','20');
    $a_report($v('P4_REPORT_ID'),'1','20','20');
    SQL Statement
    SELECT *
    FROM PRODS p WHERE PROD_CODE = :P4_SELECTED_VALUE
    The problem I have is that when the report is run (I know it is refreshing) the P4_SELECTED_VALUE bind variable is set to NULL.
    The alert pop contains the correct value and when I make the P4_SELECTED_VALUE visible it also contains the value?
    Any help is much appreciated
    Rob

    Rob,
    You need to insert P4_SELECTED_VALUE value into APEX session before refreshing the report.
    Add following 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');
    });This is how I used to do in version 3.2 or before. But now I prefer to use Declarative dynamic actions..
    Regards,
    Hari

  • HOW to get the bind variables list.

    I've the following problem : I've some SQL queries stored in my DB as VARCHAR2 values.
    I need to use DBMS_SQL in order to execute them.
    In theese SQL statements I have some bind variables like :NUMORD. (ex. SELECT 'X' FROM YYYY WHERE FIELD_1 = :NUMORD).
    I don't know "a priori" names and number of such variables.
    Is there any way to have a list of such bind variables ?
    I found DBMS_DESCRIBE but is seems to act only on stored procedures/functions.
    I know I can tray to inspect the code looking for every ':' but a cleaner solution woulf be appreciated.
    Tks
    Tullio

    I don't know "a priori" names and number of such variables.
    Is there any way to have a list of such bind variables ?The names are probably not important, but you can get the count (and other useful information) like this:
    SQL> var cur refcursor
    SQL> declare
        cl clob;
    begin
        dbms_lob.createtemporary (cl, true);
        sys.utl_xml.parsequery (user, 'select e.deptno, :x x from emp e where deptno = :deptno', cl);
        open :cur for select cl cl from dual union all
                      select 'Count binds: ' || xmlquery('count(//BIND_VARIABLE)' passing xmltype(cl) returning content).getclobval() from dual;
        dbms_lob.freetemporary (cl);
    end;
    PL/SQL procedure successfully completed.
    SQL> print cur
    CL                                                                             
    <QUERY>                                                                        
      <SELECT>                                                                     
        <SELECT_LIST>                                                              
          <SELECT_LIST_ITEM>                                                       
            <COLUMN_REF>                                                           
              <SCHEMA>MICHAEL</SCHEMA>                                             
              <TABLE>EMP</TABLE>                                                   
              <TABLE_ALIAS>E</TABLE_ALIAS>                                         
              <COLUMN>DEPTNO</COLUMN>                                              
            </COLUMN_REF>                                                          
          </SELECT_LIST_ITEM>                                                      
          <SELECT_LIST_ITEM>                                                       
            <BIND_VARIABLE>1</BIND_VARIABLE>                                       
            <COLUMN_ALIAS>X</COLUMN_ALIAS>                                         
          </SELECT_LIST_ITEM>                                                      
        </SELECT_LIST>                                                             
      </SELECT>                                                                    
      <FROM>                                                                       
        <FROM_ITEM>                                                                
          <SCHEMA>MICHAEL</SCHEMA>                                                 
          <TABLE>EMP</TABLE>                                                       
          <TABLE_ALIAS>E</TABLE_ALIAS>                                             
        </FROM_ITEM>                                                               
      </FROM>                                                                      
      <WHERE>                                                                      
        <EQ>                                                                       
          <COLUMN_REF>                                                             
            <SCHEMA>MICHAEL</SCHEMA>                                               
            <TABLE>EMP</TABLE>                                                     
            <COLUMN>DEPTNO</COLUMN>                                                
          </COLUMN_REF>                                                            
          <BIND_VARIABLE>2</BIND_VARIABLE>                                         
        </EQ>                                                                      
      </WHERE>                                                                     
    </QUERY>                                                                       
    Count binds: 2                                                                 
    2 rows selected.

  • Error with the Shared Variable Engine

    Hi,
    I have a problem with the Shared Variable Engine,
    A .doc File is attached to this message, decribing the problem with pictures.
    I will be glad if anyone can help me. 
    Sincerely yours
    Amitai Abramson
    Attachments:
    Question.doc ‏819 KB

    Hi Amitai,
    Good afternoon and I hope your well.
    A member of the team from NI Israel contacted me regarding this post.
    I want to provide you with extra details on how to resolve your issue - i.e. Repair (Or Re-install) the Shared Variable Engine.
    If you use the MsiBlast Tool it will populate a list of all MSI NI Installers. One of these will be NI Variable Engine. On the right-hand side you can the click 'Repair'. I would also Repair the engine support for the versions of LabVIEW you have installed. Please see attachments for MsiBlast and a screenshoot of the MSIBlast screen.
    If this doesn't work I would recommend re-installing LabVIEW using the following guide, which I posted on this forum. (second post by me).
    Please let me know how you get on,
    Kind Regards,
    James.
    Message Edited by Hillman on 12-03-2008 12:19 PM
    Message Edited by Hillman on 12-03-2008 12:19 PM
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!
    Attachments:
    Repair Shared Variable Engine.JPG ‏97 KB
    msiBlast.zip ‏110 KB

  • How do I know the bind variables in sql_text of V$sql

    I query V$sql ,v$sqlarea,V$SQLTEXT, the sql_text show like select customer_name from customer where id = :B1;
    How can I to get the value of :B1?
    I want to know the entire SQL command, What should I do?

    Satish Kandi wrote:
    Not too sure but check out GV$SQL_BIND_CAPTURE.Satish,
    I remembered reading an anomaly that JL posted about it, I guess it would be helpful for OP to know that there may be parameters which can tweakthe behaviour of this view.
    http://jonathanlewis.wordpress.com/2008/07/24/bind-capture/
    Regards
    Aman....

Maybe you are looking for