"Partition For" with a bind variable

Does anyone know if a bind variable can be used with the "partition for" syntax? For example,
select max(col1) into myvar from t partition for (mydate);where t is an interval-partitioned table.
I couldn't find any documentation specifically on this and all the ways I've tried it have failed :-(
Edit: version 11.2

The table has an interval partition on a date column so that all records for a particular day are stored in the same partition. The query is actually the equivalent of
select max(col1) into myvar from t
where date_col >= trunc(mydate) and date_col < trunc(mydate+1);but I'd rather use the shorter statement if possible.

Similar Messages

  • Inserting a LINESTRING with a bind variable

    Hello - I am trying to insert a LINESTRING with a bind variable. Here is my query that works:
    INSERT INTO EDGE (pts)
    VALUES (SDO_GEOMETRY('LINESTRING(-71.110157 42.513495, -71.110159 42.51359)',8307));
    But if I want to pass in the pts as a bind variable, as follows:
    INSERT INTO EDGE (pts)
    VALUES (SDO_GEOMETRY(LINESTRING(:pts),8307));
    When prompted in sqlDeveloper I set the bind variable to: -71.110157 42.513495, -71.110159 42.51359
    I get the following error: PLS-306: wrong number of types of arguments.
    Thanks!

    Thanks - Your reply worked well, but I ran into another snag. If the linestring is greater than 4000 chars, I get another error.
    ORA-01461: can bind a LONG value only for insert into a LONG column
    Are there any work arounds for this?? Below is the string I am using for the bind/insert:
    LINESTRING(
    6.169746 50.348667,6.169377 50.348584,6.168800 50.348460,6.168807 50.348434,
    6.168901 50.348392,6.168972 50.348330,6.168994 50.348279,6.168985 50.348228,
    6.168896 50.348179,6.168784 50.348150,6.168664 50.348151,6.168569 50.348183,
    6.168460 50.348251,6.168366 50.348257,6.168278 50.348243,6.168197 50.348184,
    6.168052 50.348109,6.167844 50.348082,6.167660 50.348059,6.167611 50.348019,
    6.167600 50.347887,6.167544 50.347873,6.167432 50.347869,6.167338 50.347921,
    6.167093 50.348021,6.166934 50.348044,6.166768 50.348062,6.166625 50.348084,
    6.166568 50.348065,6.166487 50.347984,6.166261 50.347901,6.166006 50.347879,
    6.165871 50.347912,6.165865 50.347968,6.165883 50.348059,6.165868 50.348090,
    6.165755 50.348041,6.165562 50.347993,6.165450 50.347974,6.165355 50.347980,
    6.165253 50.348048,6.165263 50.348109,6.165328 50.348184,6.165282 50.348231,
    6.165218 50.348252,6.165148 50.348319,6.165166 50.348395,6.165135 50.348431,
    6.165032 50.348463,6.164905 50.348460,6.164818 50.348507,6.164701 50.348610,
    6.164615 50.348647,6.164551 50.348648,6.164478 50.348614,6.164421 50.348548,
    6.164276 50.348484,6.164164 50.348471,6.163996 50.348468,6.163919 50.348550,
    6.163863 50.348572,6.163808 50.348577,6.163727 50.348548,6.163678 50.348498,
    6.163636 50.348417,6.163546 50.348301,6.163457 50.348267,6.163337 50.348254,
    6.163249 50.348235,6.163192 50.348200,6.163175 50.348139,6.163206 50.348103,
    6.163278 50.348102,6.163446 50.348130,6.163557 50.348139,6.163637 50.348122,
    6.163644 50.348092,6.163602 50.348026,6.163482 50.347982,6.163393 50.347922,
    6.163316 50.347907,6.163249 50.347894,6.163026 50.347907,6.162725 50.347983,
    6.162319 50.348029,6.161930 50.348081,6.161645 50.348130,6.161526 50.348183,
    6.161512 50.348265,6.161593 50.348304,6.161667 50.348379,6.161693 50.348491,
    6.161736 50.348587,6.161817 50.348662,6.161922 50.348691,6.162050 50.348720,
    6.162050 50.348735,6.161963 50.348757,6.161933 50.348833,6.161871 50.348885,
    6.161744 50.348928,6.161435 50.348978,6.161293 50.349026,6.161262 50.349067,
    6.161264 50.349148,6.161194 50.349225,6.161180 50.349297,6.161246 50.349372,
    6.161271 50.349438,6.161194 50.349536,6.161059 50.349568,6.160987 50.349549,
    6.160953 50.349478,6.160949 50.349300,6.160915 50.349240,6.160850 50.349185,
    6.160730 50.349156,6.160627 50.349173,6.160470 50.349292,6.160369 50.349380,
    6.160331 50.349451,6.160316 50.349482,6.160268 50.349488,6.160219 50.349443,
    6.160131 50.349434,6.160045 50.349506,6.159926 50.349539,6.159839 50.349530,
    6.159669 50.349466,6.159493 50.349428,6.159278 50.349411,6.159237 50.349381,
    6.159220 50.349325,6.159266 50.349278,6.159322 50.349278,6.159426 50.349292,
    6.159594 50.349325,6.159649 50.349304,6.159640 50.349243,6.159567 50.349193,
    6.159326 50.349130,6.159142 50.349107,6.159078 50.349078,6.159068 50.348986,
    6.159074 50.348925,6.159050 50.348895,6.158905 50.348841,6.158722 50.348844,
    6.158532 50.348908,6.158368 50.349032,6.158345 50.349088,6.158319 50.349297,
    6.158201 50.349375,6.158122 50.349392,6.158057 50.349377,6.157977 50.349353,
    6.157874 50.349370,6.157565 50.349466,6.156989 50.349667,6.156790 50.349685,
    6.156702 50.349682,6.156550 50.349648,6.156383 50.349651,6.156230 50.349612,
    6.156095 50.349599,6.156040 50.349635,6.156025 50.349706,6.156059 50.349777,
    6.156188 50.349852,6.156246 50.349912,6.156208 50.350009,6.156130 50.350051,
    6.155971 50.350089,6.155940 50.350120,6.155925 50.350155,6.155975 50.350221,
    6.156137 50.350300,6.156140 50.350407,6.156118 50.350504,6.155938 50.350633,
    6.155742 50.350763,6.155647 50.350780,6.155559 50.350771,6.155486 50.350737,
    6.155469 50.350686,6.155491 50.350604,6.155552 50.350507,6.155549 50.350380,
    6.155522 50.350304,6.155438 50.350290,6.155343 50.350321,6.155273 50.350387,
    6.155197 50.350465,6.155157 50.350534,6.155038 50.350574,6.154890 50.350603,
    6.154675 50.350606,6.154411 50.350587,6.154088 50.350565,6.153878 50.350522,
    6.153637 50.350468,6.153367 50.350438,6.153135 50.350464,6.152772 50.350519,
    6.152581 50.350529,6.152377 50.350513,6.152038 50.350445,6.151744 50.350396,
    6.151587 50.350356,6.151550 50.350303,6.151542 50.350239,6.151512 50.350193,
    6.151445 50.350168,6.151355 50.350157,6.151240 50.350087,6.151102 50.350073,
    6.150917 50.350095,6.150792 50.350104,6.150714 50.350075,6.150634 50.349996,
    6.150627 50.349950,6.150590 50.349901,6.150529 50.349879,6.150368 50.349897,
    6.150267 50.349894,6.150194 50.349846,6.150180 50.349781,6.150184 50.349697,
    6.150176 50.349613,6.150113 50.349504,6.149984 50.349418,6.149737 50.349330,
    6.149503 50.349287,6.149288 50.349290,6.149097 50.349335,6.148890 50.349407,
    6.148666 50.349521,6.148502 50.349660,6.148486 50.349725,6.148511 50.349778,
    6.148572 50.349823,6.148609 50.349869,6.148610 50.349918,6.148546 50.349988,
    6.148392 50.350043,6.148126 50.350150,6.148036 50.350163,6.147970 50.350145,
    6.147957 50.350111,6.147966 50.349973,6.148038 50.349770,6.148167 50.349673,
    6.148279 50.349599,6.148290 50.349545,6.148252 50.349465,6.148161 50.349425,
    6.148065 50.349403,6.147947 50.349455,6.147900 50.349509,6.147801 50.349609,
    6.147620 50.349791,6.147555 50.349811,6.147460 50.349839,6.147366 50.349909,
    6.147313 50.349948,6.147236 50.349957,6.147140 50.349947,6.147079 50.349902,
    6.147053 50.349811,6.147002 50.349701,6.146936 50.349675,6.146846 50.349684,
    6.146745 50.349712,6.146603 50.349764,6.146472 50.349781,6.146251 50.349761,
    6.146131 50.349778,6.146037 50.349818,6.146020 50.349871,6.146045 50.349909,
    6.146154 50.349965,6.146317 50.350031,6.146426 50.350068,6.146450 50.350105,
    6.146409 50.350140,6.146338 50.350145,6.146145 50.350094,6.145899 50.350045,
    6.145797 50.350046,6.145709 50.350085,6.145675 50.350189,6.145671 50.350258,
    6.145624 50.350293,6.145487 50.350321,6.145290 50.350324,6.145153 50.350318,
    6.145026 50.350282,6.144929 50.350207,6.144856 50.350159,6.144754 50.350149,
    6.144653 50.350165,6.144504 50.350206,6.144427 50.350214,6.144349 50.350200,
    6.144249 50.350143)

  • How do I refresh a table with a bind variable using a return listener?

    JDev 11.1.2.1.0.
    I am trying to refresh a table with a bind variable after a record is added.
    The main page has a button which, on click, calls a task flow as an inline document. This popup task flow allows the user to insert a record. It has its own transaction and does not share data controls.
    Upon task flow return, the calling button's return dialog listener is invoked which should allow the user to see the newly created item in the table. The returnListener code:
        // retrieve the bind variable and clear it of any values used to filter the table results
        BindingContainer bindings = ADFUtils.getBindings();
        AttributeBinding attr = (AttributeBinding)bindings.getControlBinding("pBpKey");
        attr.setInputValue("");
        // execute the table so it returns all rows
        OperationBinding operationBinding = bindings.getOperationBinding("ExecuteWithParams");
        operationBinding.execute();
        // set the table's iterator to the newly created row
        DCIteratorBinding iter = (DCIteratorBinding) bindings.get("AllCustomersIterator");
        Object customerId = AdfFacesContext.getCurrentInstance().getPageFlowScope().get("newCustomerId");
        iter.setCurrentRowWithKeyValue((String)customerId);
        // refresh the page
        AdfFacesContext.getCurrentInstance().addPartialTarget(this.getFilterText());
        AdfFacesContext.getCurrentInstance().addPartialTarget(this.getCustomerTable());But the table does not refresh ... The bind variable's inputText component is empty. The table flickers as if it updates. But no new values are displayed, just the ones that were previously filtered or shown.
    I can do the EXACT SAME code in a button's actionListener that I click manually and the table will refresh fine. I'm really confused and have spent almost all day on this problem.
    Will

    Both options invoke the create new record task flow. The first method runs the "reset" code shown above through the calling button's returnListener once the task flow is complete. The second method is simply a button which, after the new record is added and the task flow returns, runs the "reset" code by my clicking it manually.
    I'm thinking that the returnListener code runs before some kind of automatic ppr happens on the table. I think this because the table contents flicker to show all customers (like I intend) but then goes back to displaying the restricted contents a split second later.
    Yes, the table is in the page that invokes the taskflow.
    Here are some pictures:
    http://williverstravels.com/JDev/Forums/Threads/2337410/Step1.jpg
    http://williverstravels.com/JDev/Forums/Threads/2337410/Step2.jpg
    http://williverstravels.com/JDev/Forums/Threads/2337410/Step3.jpg
    Step1 - invoke new record task flow
    Step2 - enter data and click Finish
    Step3 - bind parameter / table filter cleared. Table flickers with all values. Table reverts to previously filterd values.

  • How to call a report with a bind variable from a multi-record block

    Hi,
    I have created a report using the BI Publisher functionality. I did all the integration, created the SQL Query and uploaded the template. Up till here everythings fine!
    My SQL Query has 2 bind variables.
    I will call my report from a multi record block, at the end of each record an icon is shown which the user can click to open the report.
    I created a column link for this item (PRINT_REPORT=Inschrijvingsformulier) but I do not manage to pass the parameters to my report. The parameters I want to pass are 2 columns in this Multi Record block.
    I created 2 hidden fields on the page P9_PARAMETER1, P9_PARAMETER2 with the same names as my bind variables and fill this in with the values #PARAMETER1#, #PARAMETER2# from the multi record block.
    It seems it does not work as my report stays empty. (also XML file stays empty).
    Am I trying the wrong way?
    Thanks for any advice,
    Kris

    hi khadeer,
         create one report program and write the required code,and call this function module 'SSF_FUNCTION_MODULE_NAME' and give your smartform name  and also when u activate ur smart form u will get one function module call that function module also and specify any tables used...
    i think this solves ur problem...
    any queries revert back..
    pls reward points if helpful,
    shylaja

  • Is there a problem using popup LOVs in a portal form with a bind variable?

    I have a portal form with 2 LOVs. The second LOV is a dependent LOV whose bind variable can be NULL. I have read Note 263923.1, "How To Create Dependent Lovs In Forms", and my form works as long as I use combo boxes to display the LOVs. I need to use popups so the user can search the LOVs as they are quite lengthy. Plus I want to be able to pick a value from my second LOV without selecting a value from the first LOV -- hence, my bind variable can be null and that is where my problem lies. As long as I select a value from the first LOV, the second LOV popup will work. If I click on the icon to display the second LOV without pre-selected a value from the first LOV, I get the following error:
    POPUP LOV ERROR:
    LOV: "9A17692880B6B8509F514F5B9CA9EC808DD403218B3CF19A33C04CD1FAB0ADE17ADC33E6B67998A933357CE5264D204E"
    Parse Message: Parse as pre-set global: "TORE".
    Find Message: LOV is of type DYNAMIC (LOV based on SQL query).
    Query: "SELECT ...."
    wwv_bind.prepare_bind: ORA-01403: no data found
    My form is based on a table with a custom layout. The sql for the second LOV is similar to: SELECT ENAME, EMPNO FROM SCOTT.EMP WHERE (DEPTNO = :DEPT AND :DEPT IS NOT NULL) OR :DEPT IS NULL.
    Thanks in advance for any help,
    Carol

    Don't use EPS any more! It does not support transparency nor color management.
    If you save vector files from Illustrator, use AI with PDF compatiblity.
    If you save image files from Photoshop, use PSD.
    If you save image files combined with vector forms and/or text from Photoshop, use PDP which is a Photoshop PDF.
    For vectors from Illustrator use CMYK files.
    For images use RGB, conversion to CMYK should never done before PDF export, better, if the printer allows it, is to export a PDF with live transparency as it is PDF/X-4
    If the printer requires a PDF with CMYK only export a PDF/X-1a.

  • Creating stored outlines for date datatype bind variable

    While trying to create stored lines for a query having date datatype I get
    ORA-00932: inconsistent datatypes: expected DATE got NUMBER error:
    desc table_t1;
    col1 number,
    datecol date
    CREATE OR REPLACE OUTLINE TEST FOR CATEGORY TEST
    ON
    select * from table_t1
    WHERE T1.COL1 IS NOT NULL
                                          AND T1.DATECOL BETWEEN TRUNC (:D1)
                                                                   AND TRUNC (:D2)
                                                                       + 1Can someone please help me what am I doing wrong?
    I also tried to declare variable of date from sqlplus but it seems sqlplus doesn't have any support for date datatype var declaration as bind variable.
    Thanks
    Kev
    Edited by: Kevin_K on Jan 3, 2011 4:48 AM

    I think in this case you would have to take an approach like this:
    alter session set set create_stored_outlines=true;
    run your sql-statement (with a date bind variable), using anonymous plsql block.
    alter session set create_stored_outlines=false;
    Not sure though. It's been a while since I played around with outlines.

  • How to use sql "IN" operator with named bind variable in where clause ?

    Can one bind variable be used for the "IN" list ('1','2','3') ?

    rob,
    No worries. Glad it helped. Glad to see also that you're doing things right and trying to use bind variables ;)
    May I suggest adding "SOLVED" to the title of the original post?
    Best,
    John

  • Problems with Date bind variable

    I'm trying to use a Date as a bind variable in a View Object, and I'm running into difficulties. I've got the bind variable type set to date, and the control hints for Format Type and Format set to "Simple Date" and "yyyy-MM-dd" respectively. When I run the application module test and enter the date in the correct format, the View Object returns the expected results. However, when I try to set a Query Bind Parameters property for a JHeadstart group in my application definition in order to set the bind variable's value from an dateField input control, I get the following exception:
    30-Jan 08:49:56 ERROR (ErrorReportingUtils) -java.lang.IllegalArgumentException
    at java.sql.Date.valueOf(Date.java:104)
    at oracle.jbo.domain.Date.toDate(Date.java:348)
    at oracle.jbo.domain.Date.<init>(Date.java:279)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at oracle.jbo.domain.TypeConvMapEntry.convert(TypeConvMapEntry.java:73)
    at oracle.jbo.domain.TypeFactory.get(TypeFactory.java:739)
    at oracle.jbo.domain.TypeFactory.getInstance(TypeFactory.java:90)
    at oracle.jbo.common.VariableImpl.convertToJava(VariableImpl.java:546)
    at oracle.jbo.common.VariableValueManagerImpl.doSetVariableValue(VariableValueManagerImpl.java:182)
    at oracle.jbo.common.VariableValueManagerImpl.setVariableValue(VariableValueManagerImpl.java:223)
    at oracle.jbo.common.VariableValueManagerImpl.setVariableValue(VariableValueManagerImpl.java:229)
    at oracle.jheadstart.model.adfbc.v2.JhsApplicationModuleImpl.applyBindParams(JhsApplicationModuleImpl.java:173)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:507)
    at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:1795)
    at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:1989)
    at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:219)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1289)
    at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:1802)
    at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:627)
    at oracle.adf.model.binding.DCInvokeActionDef$DCInvokeAction.refresh(DCInvokeActionDef.java:140)
    at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:2521)
    at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2260)
    at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareRender(PageLifecycleImpl.java:534)
    at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareRender(FacesPageLifecycle.java:98)
    at oracle.jheadstart.controller.jsf.lifecycle.JhsPageLifecycle.prepareRender(JhsPageLifecycle.java:1155)
    at oracle.adf.controller.v2.lifecycle.Lifecycle$1.execute(Lifecycle.java:297)
    at oracle.adf.controller.v2.lifecycle.Lifecycle.executePhase(Lifecycle.java:116)
    at oracle.adf.controller.faces.lifecycle.ADFPhaseListener.mav$executePhase(ADFPhaseListener.java:29)
    at oracle.adf.controller.faces.lifecycle.ADFPhaseListener$1.before(ADFPhaseListener.java:426)
    at oracle.adf.controller.faces.lifecycle.ADFPhaseListener.beforePhase(ADFPhaseListener.java:77)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:228)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
    at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
    at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
    at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    However, it seems that the value of the bind parameter did in fact change, according to the debug message issued by the JhsApplicationModuleImpl.applyBindParams(...) procedure:
    30-Jan 08:46:23 DEBUG (JhsApplicationModuleImpl) -ViewObject ViewObj: value of bind param move_date has changed: old value=null ,new value=Wed Jan 07 00:00:00 CST 2009
    One thing I have noticed that may be of interest - if I run the debugger into the JhsApplicationModuleImpl.applyBindParams(...) procedure, a default date in my bind variable shows up as an oracle.jbo.domain.Date object when it comes out of the following line:
    Object oldValue = vo.ensureVariableManager().getVariableValue(key);
    as opposed to the new value that gets sent from the input value of the dateField control, which shows up as a java.util.Date in the following line:
    Object value = args.get(key);
    In the string of functions leading up to the following in the stack trace:
                   at java.sql.Date.valueOf(Date.java:104)
    at oracle.jbo.domain.Date.toDate(Date.java:348)
    at oracle.jbo.domain.Date.<init>(Date.java:279)
    it looks like the value of the java.util.Date is converted to a string, then passed to these functions to be turned into a java.sql.Date object. However, according to the java.sql.Date.valueOf(...) function, it's expecting date in "yyyy-mm-dd" format, per the header comments:
    * Converts a string in JDBC date escape format to
    * a <code>Date</code> value.
    * @param s a <code>String</code> object representing a date in
    * in the format "yyyy-mm-dd"
    * @return a <code>java.sql.Date</code> object representing the
    * given date
    * @throws IllegalArgumentException if the date given is not in the
    * JDBC date escape format (yyyy-mm-dd)
    When the input value from the dateField input control is added as a java.util.Date, the toString() is producing the wrong date format, which could be seen in the debug output I included above that said the bind variable has changed.
    Has anyone done this before that can let me know what I am missing and how to fix this? I've search all over the web, and all the articles I've seen relating to bind variables only refer to those of numeric or string types, which aren't giving me any trouble. Even the Developer's Guide (http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/bcquerying009.htm) article "5.9 Using Named Bind Variables" doesn't reference using a Date type.

    I had the same problem about a year ago (using JHeadstart 10.1.3.2.52):
    15-feb 14:10:31 DEBUG (JhsApplicationModuleImpl) -Search item matches query bind param SubjectenKernPeildatum, value set to 2000-01-01
    15-feb 14:10:33 DEBUG (JhsApplicationModuleImpl) -Executing applyBindParams for BasServiceKern.AdresRollenSubjecten
    15-feb 14:10:33 DEBUG (JhsApplicationModuleImpl) -ViewObject AdresRollenSubjecten: value of bind param peildatum has changed: old value=null ,new value=Sat Jan 01 00:00:00 CET 2000
    15-feb 14:10:33 ERROR (ErrorReportingUtils) -java.lang.IllegalArgumentException
    at java.sql.Date.valueOf(Date.java:104)
    at oracle.jbo.domain.Date.toDate(Date.java:348)
    It appears a java.util.Date gets put on the criteria Map in the searchBean, this can't be used as input for a jbo.Date bindvariable.
    My ugly solution was to override public void applyBindParams(String voUsage,HashMap args)
    in MyProjectApplicationModuleImp (which extends JhsApplicationModuleImpl of course),
    check if value is a java.util.Date, and then
    value = new java.sql.Date(((java.util.Date)value).getTime());
    Greetings, HJ
    Edited by: HJHorst on Feb 6, 2009 12:22 AM

  • Cursor for loop vs bind variable efficiency

    PL/SQL
    I am going to need to execute many sqls within a cursor for loop.
    Note: This is pseudo pl/sql code
    for csr_rec in cursor
    loop
    insert into tablea
    select [whateever] from tableb
    where column_name = csr_rec.field
    versus
    execute immediate
    'insert into table a select ... where column_name = :1' using csr_rec.field
    So the question is whether the first insert statement will be treated as a separate sql statement and need to be parsed each iteration? If so, then I'd likely be much better of using the bind variable approach. (2nd) insert statement.
    Thanks!

    The first statement (static) will be re-used - PL/SQL variables (csr_rec.field in this case) will be used as a bind variable.

  • What is bad with this bind variable.

    i get a error bad bind variables. i dunno what is bad here.
    FUNCTION DisturbrLoops(i_currTerm IN NUMBER,
                              i_Termoutofloop IN Merc.T_NUMLIST,
                              i_currentTermonloop IN Merc.T_NUMLIST) 
                              RETURN NUMBER is
    v_sql        VARCHAR2(1000);
    cntLoops NUMBER;
    BEGIN
      BEGIN
      select count(distinct assoc1.loopid)
          from ndw_segment                  ns1,
             ndw_loop_segment_association assoc1,
             ndw_loop_segment_association assoc2,
             ndw_segment                  ns2
        where ns1.termsysid = :i_currTerm
         and ns1.segment_id = assoc1.segment_id         
         and assoc1.loopid = assoc2.loopid
         and assoc2.segment_id = ns2.segment_id
         and ns2.termsysid in
             (SELECT * FROM TABLE(CAST(:i_Termoutofloop AS Merc.T_NUMLIST)))
         and ns2.termsysid NOT in /*(1,2,3,4)*/
            (SELECT *
                FROM TABLE(CAST(:i_currentTermonloop AS Merc.T_NUMLIST)));
        EXECUTE IMMEDIATE v_sql
                BULK COLLECT INTO cntLoops 
                USING i_currTerm ,i_Termoutofloop ,i_currentTermonloop;
    /*  dbms_output.put_line(v_Termoutofloop.count);*/
      EXCEPTION
        WHEN OTHERS THEN
         -- catch all errors. what to do.
         dbms_output.put_line( SQLERRM || ' ' || SQLCODE);
        null;
      END;
    return cntLoops ;
    END DisturbrLoopsEdited by: user8798946 on Sep 14, 2009 1:45 AM

    In PL/SQL syntax there is no colon or any other symbol in front of a variable name. Just use <tt>i_currterm</tt>, <tt>i_termoutofloop</tt> etc.

  • Mobile Account on Second Partition - Mac with AD Bind

    We've recently started binding our Macs into Active Directory and are using our associates' network credentials to login. Our Macs are setup with two partitions - one for the OS and Apps and one for the associates home folders. A modified MCX setting creates a home folder on the secondary partition the first time they login.
    My problem is that the associate accounts appear as "External" instead of "Mobile" in System Preferences and our preference would be that the accounts remain "Mobile". If I let the MCX settings create the Mobile account on the OS partition in /Users, it stays a Mobile account. From there we can manually move the home folder and point the account to the secondary partition and it remains a Mobile account.
    So I'm looking for advice on deploying a home folder to a secondary partition and having it appear as "Mobile" rather than "External". Thanks!

    That just the way it is.....

  • How do I use setString() method with multiple bind variables

    I have two setString() statements and a select union statement. My class compiles but only displays the data for the first table ignoring the second setString() statement. But When I replace the "where id=?" with "where id=12 or someid", it works and displays all data found in both tables.
    Am I not properly using the setString() method?
    public class LdData{
    private String id;
    public LdData(){
    public void setId(String id)
        this.id = id;
      public String getId()
        return id;
    public Collection getLdData() throws Exception{
                    List rows = new ArrayList();
    //connection statement
    String sql_query="SELECT a,b FROM table1 WHERE id = ? " + " UNION " + "SELECT a,b FROM table2 WHERE id= ?";
    try {
                            conn = ds.getConnection();
    pstmt = conn.prepareStatement( sql_query );
    pstmt.setString(1, this.id);
    pstmt.setString(2, this.id);
    rst = pstmt.executeQuery();
    while (rst.next()) {
    //dataEntry.java - contains my getter and setter
    dataEntry info = new dataEntry(rst.getString("a"), rst.getString("b"), this.id);
    rows.add(info);
    //catch all SQLexceptions, NamingExceptions
    //close all connection
    return rows;
    //dataEntry.java - dataEntry class
    private String a;
    private String b;
    private String id;
    public dataEntry(String a, String b, String id){
    seta(a);
    setb(b);
    setbdate(bcode);
    this.a = a;
    this.b = b;
    this.id = id;
    public String getA(){
    return a;
    public String getB(){
    return b;
    public String getId(){
    return id;
    public void setA(String a){
    this.a = a;
    public void setB(String b){
    this.b = b;
    public void setId(String id){
    this.id = id;
    //index.jsp - displays data
    <jsp:useBean id="test" class="lddata" scope="request">
    <jsp:setProperty name="test" property="id" param="id"/>
    </jsp:useBean>
    <display:table name="${test.lddata}"/>

    This just doesnt make sense to me at all. :( Could it be a naming issue? I mean both tables have the same field names but different data information
    so the union will never sort and choose. And the weirdest thing is that
    //this works -
    ->String sql_query="SELECT a,b FROM table1 WHERE id = TU234 " + " UNION ALL" + "SELECT a,b FROM table2 WHERE id= TU234";
    //I also tried this, but the second statement doesnt work
    ->pstmt.setString(1, "TU234"); //this works.
    ->pstmt.setString(2, "TU234"); //this doesnt
    //It also tried this, it worked for both set statements, but I need it in an list or so.
    while (rst.next()) {
    String a = rst.getString(a);
    String b = rst.getString(b);
    String id = rst.getString(id);
    System.out.println(a+""+b+""+id);
    }Is there anyother way I can collect the data into a jsp page without using javabean?

  • [ORACLE 9] OPEN FOR statement USING bind variable

    Hi,
    I have a loop that only fetches 1 record 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The code is doing what you have asked it to do.
    Incrementing lv_compteur := lv_compteur + 1; inside the FOR LOOP will not refresh your CURSOR as the CURSOR OPEN statement is outside the loop.
    You could change your lv_qry variable to something like this:
    lv_compteur_min number(4) := 1;
    lv_compteur_max number(4) := 6;
    lv_qry := 'select client_loc from tmp_jbm where client_id BETWEEN :A AND :B';and OPEN the cursor by passing two variables
    open curtest for lv_qry using lv_compteur_min, lv_compteur_max ;

  • How to use ApplicationModuleImpl.createViewObject for VO with bind variable

    I need to implement a AM method to create VO instance from a generic VODef with bind variables.
    The createViewObject() will trigger the executeQuery of the VO before I can set up the bind variables for the query.
    What is the proper way to create view object instance with bind variables?

    I am using JDeveloper 11.1.1.2.
    I have a ViewObjectA declared with some bind variables which determine what business data to be retrieved at runtime via a service method of the ApplicationModule.
    As the ViewObjectA is only referenced internally within ApplicationModule and I need more than one instance of the ViewObjectA for different conditions at runtime,
    I use ApplicationModuleImpl.createViewObject() to create an instance of ViewObjectA instead of adding ViewObjectA to the data model of the ApplicationModule.
    Currently, when the ViewObjectA is instantiated, it also trigger an executeQuery() which will not retrieve correct data until I set up the bind variables.
    However, the createViewObject() method doesn't let me pass in the values of the binding variables.
    Currenlty, I just call the createViewObject() and then set the binding variables values and call executeQuery() again.
    Just checking if there is a better way to do so...

  • Report query with bind variable

    Trying to create a report query for xsl-fo print. For output format I pick "derive from item" then pick the item name from the list, on the next screen, I paste the query with the bind variable. on the next step test query, I always get "data not found" regardless what value I type in. This is the same query that I ran under sql commands without any issues.
    Does anyone run into the same issue as I have when attempted to create a query with bind var ? There is no problem creating a query without bind varibles. . thanks.
    Munshar

    Hi, please did you get any solution to this issue? I am having similar challenge right now.
    select     EMP.DEPTNO as DEPTNO,
         DEPT.DNAME as DNAME,
         EMP.EMPNO as EMPNO,
         EMP.ENAME as ENAME,
         EMP.JOB as JOB,
         EMP.MGR as MGR,
         EMP.HIREDATE as HIREDATE,
         EMP.SAL as SAL
    from     SCOTT.DEPT DEPT,
         SCOTT.EMP EMP
    where EMP.DEPTNO=DEPT.DEPTNO
    and      DEPT.DNAME =upper(:dname)
    This run perfectly in sql developer, toad, and even inside publisher if I login directly to publisher to create report.
    Generating this same query in shared component query builder and testing it returns no data found. If I remove the last line, it works. but with the last line, it return no data found. It seems no one has been able to provide solution to this issue

Maybe you are looking for

  • URGENT, please help...Removing password security using Batch Processing

    I have a few thousand PDFs which me and a team of colleagues have password protected but these now need the security removed. Is there anyway we can batch process the removal this security? I was thinking that if I added them to the watched folder an

  • OSMF 1.5 - Buffering UI - SerialElement with PreloadingProxyElement

    Hoping someone can help me with a few issues that I am seeing. I'm starting to think there is a bug with the buffering and using PreloadingProxyElement, but it's possible that I am using it in the wrong way. The first question, is there a concise and

  • How can version control check-in prompts be disabled?

    We are using RoboHelp 11 with TFS for version control, and the check-in prompts are killing our productivity.  The TFS interface is slow to begin with, but we are getting 3-4 prompts every time we do something as simple as renaming a file, plus tons

  • Playback sync with audio?

    It seems that in After Effects you can't play - with audio - from anywhere in the timeline, only from the beginning. But you CAN in Photoshop Extended. Doesn't seem right. (All I want to do is make a simple video sequence where images appear synced t

  • Purchase order pricing

    Hello Expert, the purchase pricing procedure is made with different item. The final net price is also used to make the average price of the procured material. But if I want the average price made with an intermediate subtotal of the pricing procedure