Sort GridControl modeled with parameterized query (bug?)

I am using JDev 3.2.3. I created a ViewObject in expert mode which contained a parameterized query:
select emp_name, salary
from employees
where
dept_no = :1
Then, through a few workarounds, I managed to create a BC4J data form containing a GridControl linked to the ViewObject.
Cleared the associated empsRowSetInfo.queryOnOpen(false).
Created a button with action event:
empsRowSetInfo.setQueryConditionParams(new Object[] {
deptId
empsRowSetInfo.executeQuery();
This all works fine.
***The problem***
If you press on a header to re-sort the grid, a bad sql query error is thrown and details shows the following bad query:
select * from (
select emp_name, salary
from employees
where
dept_no = :1)
order by asc emp_name
ORA-00904: invalid column name
The GridControl headers appear to be getting their own copy of the ViewObject's query, then misinterpretting it. This works fine for non-parameterized queries since the column names are explicit. However :1 is not a column name but a place holder in my parameterized query.
Shouldn't the headers be using the same mechanism to sort the grid as used to populate the grid model originally?
Any suggestions for a workaround? Pressing a column header fatally breaks the form. Pressing the button again to re-execute the original query continues to throw the error!
Thanks,

This is clearly a bug.
DAC is in 9.0.2 + replaced by JClient.
It might be hard to get a fix for this problem.
As far as a workaround.
You can provide your own SortDelegate.
Start with diagnosing the problem by extracting the SortDelegate class out of 'dacf-src.zip'.
Change it into a mySortDelegate.java.
Set the sortDelegate property on the gridControl. (use an instance of mySortDelegate).
You should be able to step into your implementation and see what the problem is.
Hopefully you will be able to fix the problem in your sortDelegate class.

Similar Messages

  • Snapshot with Parameterized Query?

    How could i call snapshot in IOP using a parameterized query.
    for e.g. My MDX query is as below:
    +select  {+   
    +Parameter("Measure",Member,[Measures])+
    +}on columns,+
    non empty (CrossJoin(
    +{Fiscal.[P7.2012]},+
    +{Region.[NY]},+
    +{Division.[56]},+
    +{Commodity.[333-3333]}+
    +))+
    on rows
    +from [Margin]+
    When i try to use this query for snapshot it's giving an error.
    Is there any way to make my snapshot command parameterized so that i could get data of the only measure which is required?

    Its not straightforward.
    You have to generate the xml file dynamically import it using import isadmin command and then run the snapshot query on top of it.

  • Filtering multiple-XML data model with parameters

    I have a data model that consists of a concatenation of 9 separate RSS feeds (weather information from 9 different cities coming from http://www.weather.gov/data/current_obs/????.xml, where ???? is the National Weather Service station ID). All of the feeds have exactly the same format. When I view the raw XML data, I see 9 different values of station_id and of every other tag. So the XML data looks fine. Now I'd like to be able to select one city at a time in an LOV dropdown.
    I've created a static LOV called Cities with the list of the 9 station ID's. I've created a parameter called city that is tied to that LOV.
    What I can't figure out is how to tie the selected city to the station_id field in the concatenated XML dataset.
    I've tied adding a parameter to each rss data set, entering each city's 4-character station ID into its Parameter Name field, and of course choosing city as the parameter. For example, the Parameters section for the Amarillo rss feed would show a Name of KAMA and a Value (Parameter) of city. While this seems logical, selecting the parameter on the View screen doesn't change the display.
    Is there a way to accomplish this?

    Ahhh, post as in "e-mail". DOH!
    E-mailed to you.

  • Tabular model with Direct Query issue

    Hi,
    i am creating a tabular model - Direct Query option. I am using a kind of below query to import data,
    Declare @TEST as Table (TestID int, TestName varchar(20))
    Insert into @TEST
    Select 1, 'TEst1' Union
    Select 2, 'TEst2'
    Select * from @TEST
    But the Import fails with an error similar to below,
    OLE DB or ODBC error.  An error occurred while processing the partition 'Query_``````````' in table 'Query_````````'.  The current operation was cancelled because another operation in the transaction failed.
    Any idea, why it is failing ? or is it like we shouldn't use declare statement in the Query area ?
    Please reply ...Thanks in advance !
    --------------------------- Radhai Krish | Golden Age is no more far | --------------------------

    I'm pretty sure that the query would have to be a single statement so the declare statement would be causing issues.
    So just doing this as a single union query should work:
    Select 1 as TestID, 'TEst1' as TestName Union
    Select 2, 'TEst2'
    http://darren.gosbell.com - please mark correct answers

  • Need help with parameterizing query

    Hello,
    Database Version: 11gR1
    I have created a materialized view in my database which stores the moving average of Amount and Cummulative Amount for different customers for different months. The moving average window period is 6 months..i.e., If my base table has data for a customer for a period of 1 year(JAN07-DEC07), then in the materialized view the average values will be stored for each customer as follows:
    JAN-07 --Avg(JAN-07)
    FEB-07 --Avg(JAN-07, FEB-07)
    MAR-07--Avg(JAN-07,FEB-07,MAR-07)
    APR-07--Avg(JAN-07,FEB-07,MAR-07,APR-07)
    MAY-07--Avg(JAN-07,FEB-07,MAR-07,APR-07,MAY-07)
    JUN-07--Avg(JAN-07,FEB-07,MAR-07,APR-07,MAY-07,JUN-07)
    JUL-07--Avg(FEB-07,MAR-07,APR-07,MAY-07,JUN-07,JUL-07)
    AUG-07--Avg(MAR-07,APR-07,MAY-07,JUN-07,JUL-07,AUG-07)
    SEP-07--Avg(APR-07,MAY-07,JUN-07,JUL-07,AUG-07,SEP-07)
    OCT-07--Avg(MAY-07,JUN-07,JUL-07,AUG-07,SEP-07,OCT-07)
    NOV-07--Avg(JUN-07,JUL-07,AUG-07,SEP-07,OCT-07,NOV-07)
    DEC-07--Avg(JUL-07,AUG-07,SEP-07,OCT-07,NOV-07,DEC-07)
    Actually i need the values only from the month of July...i.e., avg values for the month of July, Aug, Sep, Oct..and so..But i dont want to hard code the date value in my Materialized view Query..Because as of now the data in my base table is till Dec-07..but it may increase also..So if i hard code the value to what i require now, then in future i may again have to change the query..
    So my question is, Is there any way by which i can parameterize the date values in my materialized view query, so that my materialized view stores the data for date only which i require..
    One more problem is as and when my base table grows, my materialized table would also grow if i dont parameterize the date in the query. So i need to avoid that also..
    One solution what i thought of is to keep data in my base tables only for the required period.i.e., when i want the average values for the month of July, then the data in my base table will be only from Feb-07 to Jul-07, and for the month of Aug data will be only from Mar-07 to Aug-07 and so...So that when i refresh my MV, there will be only six months data, and the number of rows in my MV will be constant and hence the MV size also will be constant..
    Is there any way by which i can schedule to delete the data from my base table as when month changes..I want it to be done automatically when month gets changed..So if anybody knows of a way to do it, Please help me...
    It will be of great help..

    Hi,
    You're creating a materialized view with one row for every combination of customer_id and month, but you don't really want all those rows. What you really want are just the rows where month=target_month, and you (wisely) don't want to hard-code "month=target_month" into the WHERE-clause of the view definition. Is that right?
    If so, you can create a one-row table called param, which has a column for storing the target_month. Your view can do a scalar sub-query or a cross-join to get the value from the param table to use in its WHERE-clause.

  • ANY wild Card is not working in MODEL - What is wong with my query?

    Hi Gurus,
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    CREATE TABLE "SALES"
       (     "COUNTRY" VARCHAR2(5 BYTE),
         "PRODUCT" VARCHAR2(5 BYTE),
         "YEAR" NUMBER,
         "SALES" NUMBER
    insert into sales values('A','prod1',2000,10);When I pass the product name in the model calsue I am getting the expected result
    select *
    from sales
    model
    PARTITION BY (country)
    dimension by (product,year)
    measures(sales s)
    rules  upsert
    s['prod1',2001]=s['prod1',2000]*2
    COUNTRY PRODUCT YEAR S
    A       prod1   2000 10
    A       prod1   2001 20 but When I use, ANY, I am not getting the result. What is wrong with my query?
    select *
    from sales
    model
    PARTITION BY (country)
    dimension by (product,year)
    measures(sales s)
    rules  upsert
    s[ANY,2001]=s[cv(product),2000]*2
    COUNTRY PRODUCT YEAR S
    A       prod1   2000 10 Thanks in advance.
    Edited by: 884476 on Oct 29, 2012 12:51 AM
    Please feel free to ask any further details required..

    You need to use UPSERT ALL rather than just UPSERT.
    The documentation [url http://docs.oracle.com/cd/E11882_01/server.112/e25554/sqlmodel.htm#i1011770]here explains that UPSERT can only insert with "positional reference" and not "symbolic reference", and ANY wildcard is always "symbolic reference". But UPSERT ALL allows model rules with existential predicates (comparisons, IN, ANY, and so on) in their left side to have UPSERT behavior.

  • ADF how can i execute a query with parameters when the page renders

    hi
    i am using ADF web 11g
    i need to execute a query with parameters when the page renders
    thanks

    hello,
    I'm a fan of Java code, I really am.
    But when you use ADF, you decided to move to a more declarative environment.
    So why not do it declarative, the adf way?
    In your pagedef insert a action binding.
    This can be anything, a call to the application module, a call on the iterator(Like executeWithparams, etc.)
    Create an invokeAction in your pagedef and set the condition.
    This example refreshes(Action 2 is execute query) the data.
    First the method binding:
        <action IterBinding="PersoonIterator" id="Execute" InstanceName="LSAppModuleDataControl.Persoon"
                DataControl="LSAppModuleDataControl" RequiresUpdateModel="true" Action="2"/>And the invoke action
        <invokeAction Binds="Execute" id="refreshData"/>This always refreshes the data on page entry, but anything is possible, you can set condictions for the invokeAction.
    -Anton
    PS Yes I know that pagedefs become backing beans in the end and yes that is Java code, but if you wanna play the ADF way, the goal is the reduction of Java code and the increased performance of declarative programming.

  • Query with parameters syntax

    Hi,
    Could somebody please help with the C# syntax for Oracle Lite. I can execute select statement without parameters, but parameterized query doesn’t work. What is wrong in my code?
    LiteConnection liteConn=new LiteConnection("10270_pwcoffline");
    LiteCommand lcmd=new LiteCommand() ;
    lcmd.Connection=liteConn;
    lcmd.CommandText="Select * from ol_off_dept where office = :off";
    lcmd.CommandType=CommandType.Text ;
    int off = 10;
    LiteParameter p1 = new LiteParameter("off", DbType.VarNumeric, "office");
    p1.Value = off;
    lcmd.Parameters.Add(p1);
    LiteDataAdapter lad=new LiteDataAdapter(lcmd);
    DataSet ds=new DataSet();
    lad.Fill(ds,"TDM");
    this.dataGrid1.DataSource = ds;
    The error is:
    System.Data.DataException: 37000[POL-5228] syntax error at Oracle.Lite.Data.LiteCommand.Prepare()…
    Thanks

    Jenny,
    Please let us know if you still need this post resolved.
    Thank you.

  • Linking Session Model with query model

    Hi All,
    How do we implement a basic Session Model? Can we use a Session Model similar to Query Model and bind all the columns/attributes with that of ViewBean's ? Does Studio support that. We have a requirement wherein we need to manipulate the fields in the session across page request and then update the database from session. Is there any way to transfer values from Session Model to Query Model at runtime? Please throw some light on this topic.
    Thanks
    Allam

    All models work the same when it comes to binding to display fields of ViewBeans and TiledViews.
    A SessionModel does operate a little different though. The fields of a SessionModel are just "passthrough vehicles". In other words, when value is set on a display field that is bound to a SessionModel field, that value is not stored in the model, like a QueryModel, rather the value is written directly to the HTTPSession attribute immediately. There is not need to "execute" the model to make it update it's backend datastore, like a QueryModel with a DB.
    As for transferring values from SessionModel to a QueryModel, you would have to do that manually, but I think you are missing the point of the SessionModel. It was meant as a means to bind a view's display fields to the HTTPSession and not much more. If you want to use a QueryModel over several page requests and update it at the end you can just "session" the QueryModel.
    The QueryModel (and other executable models) have an API that declares them to be stored in session at the end of the request, and retreived from session when you get the model.
    See the javadocs for
    getModel(<Model>, <String>, <boolean>, <boolean>)
    and then let me know if you have further questions.
    craig

  • Publisher11g - no return data with a data model from logical query

    Hi, i am usign publisher11g with obiee bi server autenthication.
    On rpd i define a security model with a user variable, a initialization block and a where over one fact table.
    When i create a answer report, bi server automatically include on the wher something like this: where user = 'name'.
    Well, when i create a publisher report and try to view data from this fact table, return no data.
    If i create a data model only with a dimension table, not over automatic where from bi server, the report return data.
    View the log nqquery, i see that the generate query include where user ='', not include the value of a session variable.
    Any idea?
    Thanks.

    I do have one question, is the member Balancesheet already in the outline?
    Yes
    **Measure
    Balance Sheet
    Profit and Loss**
    Also in the load rule did you change the dimension load settings for the accounts dimension to be parent/child for the accounts dimension.
    Field Properties -> Dimension Build Properites
    Dimension=
    Field 1 Measure; Type = Parent
    Field 2 Measure; Type = Child
    Field 2 Measure; Type = Alais
    OK
    Quite often people don't realize they have to double click on the dimension name to make sure it gets put as the dimension that gets changed.
    I'm pretty sure your issue is it is trying to do the data load and not the dim build,but that could just be the first problem
    **Click on Dimension Build Field
    Click on Dimension Build setting
    Dimension = Measure; Build Method; = Parent/ Child**
    Please advise

  • Unable to connect: incorrect log on parameters. (CR with InfoSet Query)

    Hi ,
    I have created a crystal report with InfoSet Query in Crystal Report Designer 2011. And it works fine, data extraction also works fine. After that, I have uploaded it into BI Platform 4.0. I can display the CR via clicking View from context menu. But it was still failed once I tried to schedule it in BI launch Pad.
    The error message is : Error in File ~tmp314c6a47c20e892.rpt: Unable to connect: incorrect log on parameters.
    It's so stranger, since i can view it in Designer and viewing it direct in BI lauch Pad. Do you have met this same issue within BI Platform 4.0. Thanks.
    Best Regards,
    Simon Shen

    Not sure if this will help but I finally had success with running a report with a database connection. Here is what I learned from other posts:
    1) Make sure you are using the ODBCAD32.exe located in \windows\syswow64 folder. It's the 32 bit Administrator, the one in the Control Panel is the 64 bit versions and it won't work with a 32 bit app.
    2) Make sure you use System DSN, not User DSN.
    Other tips...
    1) Create a blank report (no parameters, no db connection). Run and get that to work first.
    2) Create a basic db report (no parameters, one table, one field). Run and get that to work second.
    3) If step two fails, try creating a report with different drivers.
    4) If step three fails, try installing the latest service packs and repeat 1-3.
    5) If step four fails, throw out the software or computer or both

  • How to query Database with Parameters  and configure null value response?

    Hi,
    1.When capture attributes from forms & after applying several logics, passing to a DB table using an API, how to get relevant values for a given parameter in another DB table ?
    2.When a DB table is queried, if the value does not exist, how to configure the response message ?
    Thanks.

    Okay, you've provided exactly what John S. asked for - and no more. This is helpful, but not enough. I think we're going to need a use case to understand exactly what you are asking. What should the user see? What does the user do next? What should happen in the database and in the application when the user does this?
    However, I'll try to read between the lines a bit, and get you part of the way there. To query the database with parameters in ADF BC, you need a View Object (VO). The simplest thing to do is create the SELECT command behind the VO with some bind variables and add the bind variables to your VO. At that point, you will get an ExecuteWithParameters operation in the Data Control. You can drag that operation onto a JSF page and it will give you an option to create a parameter form to let the user fill in the parameters to set the bind variables, and a button to execute the query with these values. Any table or form based on that same VO will show the selected data.
    A Trinidad or ADF Rich Faces table will have an attribute to let you define some text to show the user if no data was retrieved by the query. But there are other ways to determine if data was retrieved which you can use to control other ways to display this information. For instance, I have a page that has an outputText component that has a "rendered" attribute to show the text only when there was no data retrieved by a query.

  • How to create messages with parameters In ADF model.

    In ADF model, How to create messages with parameters?

    To Create messages in message bundles with parameters, perform the steps as given below
    Scenario: To Create a message as "Department Name XXXXXXX is already existing "
    Step#1: For the given entity object “DepartmentEO”, Go to “overview” tab and click “Business Rules” finger tab.
    Step#2: Select “Entity Validators” in the list & click “+” to add a new entity level validation rule.
    Step#3: Now go to “Failure Handling” tab, and click the Magnifier Icon.
    Step#4: Now in the “Display Value” field, enter the message with flower-braces as below.
    Department Name {department_name} is already existing
    Step#5: Also modify the Key & Description fields as needed. And click “Save and Select” button.
    Step#6: Now go to “Token Message Expressions” section, double-click the Expression field corresponding to "department_name" & give the relevant Attribute names say "DepartmentName"
    Step#7: Now click “OK”.

  • : "Invalid object name '#Temp'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

     Hi   .
        I was creating the  pass the values t in temp tables  though s sis package vs2012 .
      First I was taken on executive SQL TASK.
     IN EXCUTIVE SQL TASK  . I was write the stored proce:
    Sp;
    reate  procedure  USP_GETEMP2333
    AS
    begin
    Select  eid,ename,dept,salary from emp
    end;
    create table #temp(eid int,ename varchar(20),dept varchar(20),salary int)
      insert into #temp
       exec USP_GETMP02333
       go.
     It was executive correctly.
     I was taken another sequence container. In the sequence container iam creating one   executive  sql
    In 2<sup>nd</sup> excutive sql task: sql statements is
    if object_id('emp_fact_sal') is not null
     drop table emp_fact_sal
    select eid,ename as emp_name,sal_bar=
    case when salary<=5000 then 'l'
    when salary >5000 and salary<=7000 then 'm'
    else
    'h'
    end
    into emp_fact_sal from #temp.
     and one falt flies  it was taken to designation .
     iam changing  all  connection properties:
     in oldeb connection:
    in excutive sal task properties .
    delay validation is true,
    and retain connection maner is also true,
    and package mode is 64 bit is false.
     But iwas excutive in 2<sup>nd</sup> excutive ql task .
    Iam getting this type of errors,
                    [Execute SQL Task] Error: Executing the query " if object_id('emp_fact_sal') is not null
     drop ta..." failed with the following error: "Invalid object name '#Temp'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established
    correctly.
     Please help me

    Arthur suggestion works but you shouldnt even be doing this on a SQL Task.
    Use a data flow task. You'll have better control over the data that is being transfered and get better performance because no staging table will be used.
    Just because there are clouds in the sky it doesn't mean it isn't blue. But someone will come and argue that in addition to clouds, birds, airplanes, pollution, sunsets, daltonism and nuclear bombs, all adding different colours to the sky, this
    is an undocumented behavior and should not be relied upon.

  • Query sql with parameters

    Hi. I create a ViewObject with the query
    SELECT Tblagenda.idagenda,
    Tblagenda.data_agenda,
    Tblagenda.dono
    FROM TBLAGENDA Tblagenda
    WHERE Tblagenda.idagenda = ?
    Please, how to setup the query parameter in runtime? Somebody could show me a example or tutorial?
    I´m using MySQL.
    Thanks

    Hi,
    this is what we have developer guides for. Please have a look at bind parameter usage in
    http://download-uk.oracle.com/docs/html/B25947_01/toc.htm
    Frank

Maybe you are looking for

  • Problem Installing SQL Server 2012

    Hello,  I am currently trying to install SQL Server 2012 and I'm having a problem.  When I try to install a "New SQL Server stand alone installation..." from the SQL Server Installation Center, it gives me the error: An error occurred during the inst

  • My ipod touch 5th gen stopped working

    it won't turn on and it had more that half battery so the battery didn't finish but the screen won't turn on or anything and i plugged it into my computer but it still won't work

  • I want to delete my account

    So I got to contact someone to do it so can someone do it for me like right now? I dont want to use skype anymore.

  • Script error: Window does not have a constructor: 324

    File-script-image processor then a script error: Window does not have a constructor:324 trying to run a batch to resize photos and this happens everytime.  Same thing is said in all options under script.

  • Reflection on JavaFx

    On Java, when we want to invoke a method from an existing instance of an object, we can simply call: public Object invoke(Object obj,                      Object... args)               throws IllegalAccessException,                      IllegalArgume