Iterate query result - put specific rows in a collection and do output

JDeveloper 11.1.1.3.0
Oracle Lite: 10.2.0.1.0
Browser: IE 7
Hi,
please help me in working on following requirement:
1. Iterate the View Object Query Result
2. Do some calculation on the Rows, lets say:
Concatination of column1 and column2 and place it in a non database Attribute "column3"
3. How to handle/place the non database attribute?
4. Fetch specific rows from the query result; there should be a comparison, like checking master and detail hierachy struktur:
Take Column1_ID (Master) check in columns2_ID (Detail), when found detail take this Row and place it in a buffer (Maybe ArrayList, or something like that)
5. Show the Chace(ArrayList) to user, in a form of View Object, with standard functions like sorting and filtering
Till now my process of solving the above requiremnts are:
To Point 1:
Created a service method in Application Implementation Class
   public void iterateEmp(){
     EmployeesVOImpl vo = getEmployeesVO1();
     while (vo.hasNext()){
      EmployeesVORowImpl row = (EmployeesVORowImpl)vo.next();
      System.out.println(row.getEmployeeId() + " | " + row.getFirstName() + " | " + row.getLastName() + " | " +  row.getEmail());   
      //row.setCalcCol(row.getFirstName() + "," + row.getLastName());
     }To point 2:
Added an attribute to the View Object, with updateable and Queryable options. Place it on the JSPX Page.
With setter method, filled with values, for example (non Database Attributes Name is CalcCol):
Name:
//see above code
row.setCalcCol(row.getFirstName() + "," + row.getLastName());When doing so, on initial Call the values will be representated, but when sorting o filtering will be done, the values then will be erased.
3. Added an Attribute in View Object "Attributes Panel".
Here the XML Code of the View Object:
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
<!---->
<ViewObject
  xmlns="http://xmlns.oracle.com/bc4j"
  Name="EmployeesVO"
  Version="11.1.1.56.60"
  BindingStyle="OracleName"
  CustomQuery="true"
  ComponentClass="model.EmployeesVOImpl"
  PageIterMode="Full"
  UseGlueCode="false"
  RowClass="model.EmployeesVORowImpl">
  <DesignTime>
    <Attr Name="_codeGenFlag2" Value="Access|Coll|VarAccess"/>
    <Attr Name="_isExpertMode" Value="true"/>
    <Attr Name="_isCodegen" Value="true"/>
  </DesignTime>
  <SQLQuery>
    <![CDATA[select employee_id, first_name, last_name, email from employees]]>
  </SQLQuery>
  <ViewAttribute
    Name="EmployeeId"
    IsUpdateable="false"
    IsPersistent="false"
    IsNotNull="true"
    PrecisionRule="true"
    Precision="6"
    Scale="0"
    Type="oracle.jbo.domain.Number"
    ColumnType="NUMBER"
    AliasName="EMPLOYEE_ID"
    Expression="EMPLOYEE_ID"
    SQLType="NUMERIC">
    <DesignTime>
      <Attr Name="_DisplaySize" Value="22"/>
    </DesignTime>
  </ViewAttribute>
  <ViewAttribute
    Name="FirstName"
    IsUpdateable="false"
    IsPersistent="false"
    PrecisionRule="true"
    Precision="20"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    AliasName="FIRST_NAME"
    Expression="FIRST_NAME"
    SQLType="VARCHAR">
    <DesignTime>
      <Attr Name="_DisplaySize" Value="20"/>
    </DesignTime>
  </ViewAttribute>
  <ViewAttribute
    Name="LastName"
    IsUpdateable="false"
    IsPersistent="false"
    IsNotNull="true"
    PrecisionRule="true"
    Precision="25"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    AliasName="LAST_NAME"
    Expression="LAST_NAME"
    SQLType="VARCHAR">
    <DesignTime>
      <Attr Name="_DisplaySize" Value="25"/>
    </DesignTime>
  </ViewAttribute>
  <ViewAttribute
    Name="Email"
    IsUpdateable="false"
    IsPersistent="false"
    IsNotNull="true"
    PrecisionRule="true"
    Precision="25"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    AliasName="EMAIL"
    Expression="EMAIL"
    SQLType="VARCHAR">
    <DesignTime>
      <Attr Name="_DisplaySize" Value="25"/>
    </DesignTime>
  </ViewAttribute>
  <ViewAttribute
    Name="CalcCol"
    IsSelected="false"
    IsPersistent="false"
    PrecisionRule="true"
    Type="java.lang.String"
    ColumnType="VARCHAR2"
    AliasName="VIEW_ATTR"
    SQLType="VARCHAR"/>
  <AttrArray Name="KeyAttributes">
    <Item Value="EmployeeId"/>
  </AttrArray>
</ViewObject>To Point 4:
There should be a specific sort order, which i have to code in ADF.
Just to give an overview:
Colum1 and Column2 (nothing to do with the emp table) have relationship. Several hierachies are existing in the Query Result.
For identifying the start point of any of these hierachies, i have to iterate through the Query Result and fetch these start point
and buffer it in an array or something like that.So in the end i have to get the same query Result but with different Sort Order.
How to buffer theses Rows (Array?) and show in a View Object?
Can we use the same view Object for solving that, or should we use another View Object which catches the new Result Set?
To Point 5:
The Result should be, as mentioned above, a View Object including new Result Set, which can provide standard behavior (sort, filter)
I hope the requirement is defined clearly enough, so maybe you can make some suggestions on that.
Thank you for replies.
Edited by: user9198377 on 13.07.2011 02:52

Hi.. You can do this without DB View. Have CalcCol transient attribute in VO. Instead of iterating VO rows and setting CalcCol attr, generate View Row Impl class. Inside getCalcCol(), write your logic. This will be called during each and every request so that transient attr data won't become null during sorting and filtering. If your VO is entity driven, do the same in Entity impl class
Raghu
Edited by: Raguraman on Sep 5, 2011 9:48 AM

Similar Messages

  • PUT QUERY RESULT ON ONE ROW INSTEAD OF MULTIPLE ONE

    Hi
    I have two tables with the column id_table1 to join them.
    My first table "table_one" contain 3 fields and one record.
    id_table1 : 1
    table1 : project1
    date_project : 2005/08/01
    My second table "table_two" contain 3 fileds and 3 records which contain the id 1 on the join column.
    id_table2 : 1
    table2 : pdf
    id_table1 : 1
    id_table2 : 2
    table2 : excel
    id_table1 : 1
    id_table2 : 3
    table2 : text
    id_table1 : 1
    If i did a simply join, the result is appear in 3 lines:
    1 project1 2005/08/01 excel
    1 project1 2005/08/01 pdf
    1 project1 2005/08/01 text
    Is this possible to have this result in one query :
    1 project1 2005/08/01 excel pdf text
    I mean to have the result in one row and a separated column for each item of the table2.
    We know how to do it with one column concatened ("excel pdf text") but not with separated column
    ("excel" "pdf" "text")
    Thanks if someone has a solution.
    Alexandre

    SQL> select e.job, d.dname from emp e, dept d where e.deptno = d.deptno;
    JOB       DNAME
    CLERK     RESEARCH
    SALESMAN  SALES
    SALESMAN  SALES
    MANAGER   RESEARCH
    SALESMAN  SALES
    MANAGER   SALES
    MANAGER   ACCOUNTING
    ANALYST   RESEARCH
    PRESIDENT ACCOUNTING
    SALESMAN  SALES
    CLERK     RESEARCH
    CLERK     SALES
    ANALYST   RESEARCH
    CLERK     ACCOUNTING
    14 rows selected.
    SQL> select e.job,
      2  max(decode(d.dname,'RESEARCH',d.dname,null)) "Research",
      3  max(decode(d.dname,'SALES',d.dname, null)) "Sales",
      4  max(decode(d.dname,'ACCOUNTING',d.dname,null)) "Accounting"
      5  from emp e, dept d where e.deptno = d.deptno
      6  group by job
      7  /
    JOB       Research       Sales          Accounting
    ANALYST   RESEARCH
    CLERK     RESEARCH       SALES          ACCOUNTING
    MANAGER   RESEARCH       SALES          ACCOUNTING
    PRESIDENT                               ACCOUNTING
    SALESMAN                 SALESRgds.

  • Query Results: Retrieve All Rows?

    I was looking for a feature that will allow me to choose to return "all records" to the Query Results window. The current behavior is to fetch 50 records at a time (e.g. fetch 50 records as you scroll through the results = s-l-o-w). What I'd like to do is "Retrieve All Rows" then use to the scroll bar to "smoothly" scroll to the last record. For example, the 8.0.6 version of Query Builder had this functionality and in SQL Developer 3.0, if I right-click on the results. I can choose to "Count Rows...", seems like this would be a perfect place to put a "Retrieve All Rows" option.

    Hi,
    My advice: do something only if there is a business case for it; satisfying your curiosity can get surprisingly expensive.
    You have already read about using Run Statement to execute a SQL statement, then Ctrl-End to auto-scroll to the end. You can try the same for Run Script, but first you will probably need to increase the value of Tools|Preferences|Database|Worksheet|Max rows to print in a script. Of course, taking either of these approaches slows things down due to displaying output and scrolling. Same with SQL*Plus. And, as mentioned previously, Java memory management in SQL Developer can cause slow downs and hangs if the result set is large enough.
    Here is a way to minimize that delay, avoid hangs, and get a more repeatable result:
    1) Save some query to, say, C:\Temp\AllCustomers.sql. For example, "select * from customers;" or "select id from customers;".
    2) Run it from a SQL Developer worksheet using Run Script (F5), or from the SQL*Plus command line, with a script like this:
    set timing on
    set termout off
    spool C:\Temp\AllCustomers.lst
    @C:\Temp\AllCustomers.sql
    spool offEven then you will see that the timing results will vary. Maybe "select *" runs much slower than "select id" because the logical output lines are long and get wrapped into multiple physical output lines in the file. Minimize that by setting linesize to a longer value (but only in SQL*Plus -- it isn't supported in SQL Developer) and repeat the test to see. Maybe SQL*Plus runs it much faster than SQL Developer because one is a command line environment and the other a GUI tool with more overhead. Or maybe the SQL Developer JVM is near its size limit and lots of Java garbage collection is slowing it down. Simple question, complicated answer.
    Regards,
    Gary
    SQL Developer Team
    P.S.: And if by chance you are using a version of SQL Developer so old it does not include the output time in the query result tab's toolbar, using Run Script with set timing on is your only recourse.
    Edited by: gggraham on Oct 27, 2011 4:54 PM

  • Extract data on specific rows in Excel file and add it to different word document on specific rows

    I was wondering about if it's possible to set up some kind of vba for this function. I have one worksheet with different data in. Where it is written the same thing like 1A & 2A And 1B & 2B
    And if i could put this information on specific rows in a Word document.
    I would like to have all of the different data on row 1 in one specific row in a word sheet for it self and the different data on on row 2 copied into different rows in a new word document if it's possible to do some kind of domino effect of this where it can
    run 5000 diffrent rows with this kind of inputs,
    Im sorry for the bad explanation i did not really know how to translate it as good as possible, write back if you have any question!
    Cell 1A: Bmw Cell 1B: Automatic Cell 1C: Diesel Cell 1D: 2014
    Cell 2A: Volvo Cell 2B: Manual Cell 2C: Bensin Cell 2D: 2010

    Run this code in Excel.
    Sub PushToWord()
    Dim objWord As New Word.Application
    Dim doc As Word.Document
    Dim bkmk As Word.Bookmark
    sWdFileName = Application.GetOpenFilename(, , , , False)
    Set doc = objWord.Documents.Open(sWdFileName)
    objWord.activedocument.variables("BrokerFirstName").Value = Range("BrokerFirstName").Value
    objWord.activedocument.variables("BrokerLastName").Value = Range("BrokerLastName").Value
    ActiveDocument.Fields.Update
    objWord.Visible = True
    End Sub
    You must add a few DocVariables to your Word document.  See these links for more information.
    http://word.tips.net/T000813_Understanding_Document_Variables.html
    https://www.youtube.com/watch?v=aABYENF1bMI
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Cfinclude query: return result for specific row

    I've been trying to crack this all day and I feel like if I
    just had a nudge in the right direction I might be successful.
    I have a query that returns the records for some textbooks
    that are at a specific school. I've normalized the textbook
    database so that the primary, secondary and tertiary subject
    categories are represented by the primary key of that category in
    its own table. As the query loops through the records, I want it to
    return the (varchar) subject category that goes with that
    (numerical) key in the table.
    Since Coldfusion won't allow nested cfoutput, I've tried
    using cfinclude to grab the specific name for the subject category
    that goes with the current textbook - but what I've got so far
    returns all the subjects for the school id in each row - they're
    the right subjects! but I don't want all of them, just the right
    one with the right book/record. Can anyone suggest what I need to
    do? I'm attaching the code for the main page and for one of the
    cfincludes (they're identical except for "primary", "secondary" and
    "tertiary").
    I realize I must be leaving something out but I can't figure
    out what. Thanks much in advance.

    Marianne,
    Glad I could help. To meet your requirement it seems like you
    would add one field to my schema in the Subjects table:
    parentSubjectId number (FK)
    That would simply be a recursive reference to another
    subject's ID to which it falls under. Maybe that doesn't make sense
    so here's some example data:
    subjectId, subjectName, parentSubjectId
    1, "Language Arts", null
    2, "Reading", 1
    3, "Phonics", 2
    4, "Other Subject with no parent", null
    So you can see we have built ourselves a nice hierarchy,
    where subjects which fall under other subjects can reference them.
    When you go to allow subjects to be chosen you can then query after
    each drop-down selection by refreshing the page (or via AJAX) to
    get its subjects. In this case we could also possibly do away with
    the "Ranking" field in our linking table since our hierarchy is
    captured in the relationships we now have, but for the sake of
    making our lives easy, let's keep it.
    Like let's say we select "Language arts" with a subjectId of
    1, we can get its child subjects like:
    <cfquery name="getChildSubjects"
    datasource="#Request.dsn#">
    SELECT s.subjectId, s.subjectName
    FROM subjects s
    WHERE s.parentSubjectId = <cfqueryparam
    cfsqltype="cf_sql_integer" value="#URL.subjectId#" />
    ORDER BY s.subjectName
    </cfquery>
    Obviously, modifications would need to be made to fit your
    schema, variable names, etc. but that's the general principles.
    As for how to associate textbooks to subjects you will
    actually be inserting one record into the linking table for each
    subject selected. So let's say you have a book "XSS for dummies."
    To insert the book you would add a single record in your
    textbook table, maybe something like:
    INSERT INTO textbook (
    textbookId,
    textbookName,
    <!--- Other fields go here, etc... --->
    ) VALUES (
    1,
    'XSS for dummies',
    <!--- Other fields go here, etc... --->
    Now, the user has selected three subjects: Computer Science
    (ID: 5), Internet and Web Topics (ID: 11), and Security (ID:98). We
    will thus insert three records into our linking table like:
    INSERT INTO textbookSubjects (
    textbookId,
    subjectId,
    ranking
    ) VALUES (
    1,
    5,
    'Primary'
    INSERT INTO textbookSubjects (
    textbookId,
    subjectId,
    ranking
    ) VALUES (
    1,
    11,
    'Secondary'
    INSERT INTO textbookSubjects (
    textbookId,
    subjectId,
    ranking
    ) VALUES (
    1,
    98,
    'Tertiary'
    So now when we query to get all our textbooks and related
    subjects, we have something like this:
    SELECT t.textbookId, t.textbookName, s.subjectId,
    s.subjectName, ts.ranking
    FROM textbook t
    LEFT JOIN textbookSubjects ts
    ON t.textbookId = ts.textbookId
    LEFT JOIN subject s
    ON t.subjectId = s.subjectId
    ORDER BY t.textbookName
    An example dataset might look like:
    textbookId, textbookName, subjectId, subjectName, ranking
    1, "XSS for Dummies", 5, "Computer Science", "Primary"
    1, "XSS for Dummies", 11, "Internet and Web Topics",
    "Secondary"
    1, "XSS for Dummies", 98, "Security", "Tertiary"
    2, "Some Other Book With No Subjects", null, null, null
    Now if we iterate over this dataset, you will end up
    outputting the textbook 3 times, which is probably not what you
    wanted. So to control this we can do something like:
    <cfoutput query="myBooks" group="textbookId">
    <tr>
    <td>#myBooks.textbookName#</td>
    <!--- Show all the subjects --->
    <td>
    <!--- These cfoutput tags with no group will give you all
    the values for the current group --->
    <cfoutput>
    #myBooks.subjectName#<br />
    </cfoutput>
    </td>
    </tr>
    </cfoutput>
    These examples are obviously brief but I hope they get the
    point across and help you accomplish what you're trying to
    do.

  • Exporting query results into a csv file using arabic and hebrew chars

    Hi,
    iv'e encountered a problem, using plsql to export a query into a csv file.. the arabic turns into question mark. Do you have any idea why?

    Usually this indicates a mismatch between client and database character set.
    How do you export this query?
    What is your database version?
    What is your client OS?
    T.

  • How to Parse JSP query results to XML Document ???

    Hey Guys, I am querying a DB with huge amount of traffic. A user select a particular lot and then details of the lot will be displayed in the following page. My concern here is that it takes really LONG to retrieve back the results coz it has to requiry in the following JSP page.
    I was told to use XML to retrieve the dataset and store it. Hence, in the following query it will re-query only from the recordsets in the XML file (...Logically, should be faster rite ? )
    My question is how do I go about doing this ? Any sort of suggestion , help, reference would be deeply appreciated ..Thanks !

    Why not take the result set and populate zero or more Java objects with data from each row in the result set? Then you can easily sort the data by putting the objects into a collection and using different Comparator objects for your sort. I'm just not sure why you want to use XML if the data isn't getting transfered between systems. In my experience XML is best used when you need a readable content for something (such as a properties file) or you want to share data between systems. I might be missing something, but I think you are better off storing your data in java and sorting it there.

  • View results in more ROW then Select.

    Hello,
    I am trying to create a view and for some reason when I just run the select statement of that view, i get 11 rows. But when i create the view, i get 106 rows.
    I am really stomped and need to know what's causing this.
    -----------------------------When i execute this view, i get 106 rows -----------------------
    CREATE OR REPLACE VIEW REGRPT_CONS_SPECIAL_FEE_VIEW
    (REG_CONFERENCE_ID, COMPANY, CONF_REFERENCE_CODE, CONF_DESCRIPTION, REG_SESSION_ID,
    SESS_REFERENCE_CODE, BEGIN_DATE, END_DATE, SESS_DESCRIPTION, CONSULTANT_ID,
    SPECIAL_FEE_AMOUNT, REASON, REGISTERED)
    AS
    SELECT DISTINCT RCC.REG_CONFERENCE_ID
         , RCC.COMPANY
         , RC.REFERENCE_CODE
         , RCT.DESCRIPTION
         , RS.ID
         , RS.REFERENCE_CODE
         , RS.BEGIN_DATE
         , RS.END_DATE
         , RST.non_html_DESCRIPTION
         , rsf.consultant_no
         , rsf.fee_amount
         , rsf.reason
         , 'Y'
    FROM reg_conference_company@webtst rcc
         , reg_conference@webtst rc
         , reg_conference_type@webtst rct
         , reg_session@webtst rs
         , reg_session_t@webtst rst
         , locale@webtst l
         , reg_special_fee@webtst rsf
         , reg_consultant@webtst rcons
    WHERE rcc.reg_conference_id = rc.ID
    AND rc.reg_conference_type_id = rct.ID
    AND RC.ID = RS.REG_CONFERENCE_ID
    AND rs.ID = rst.reg_session_id
    AND rst.locale_id = l.ID
    AND l.language_id = '1'
    AND L.COMPANY = RCC.COMPANY
    AND rc.ID = rsf.reg_conference_id
    AND rcc.company = rsf.company
    AND rs.ID = rcons.reg_session_id
    AND rsf.company = rcons.company
    AND rsf.consultant_no = rcons.consultant_no
    AND rcons.status <> 'C'
    UNION
    --- consultants not registered and in special fee
    SELECT DISTINCT RCC.REG_CONFERENCE_ID
         , RCC.COMPANY
         , RC.REFERENCE_CODE
         , RCT.DESCRIPTION
         , RS.ID
         , RS.REFERENCE_CODE
         , RS.BEGIN_DATE
         , RS.END_DATE
         , RST.non_html_DESCRIPTION
         , rsf.consultant_no
         , rsf.fee_amount
         , rsf.reason
         , 'N'
    FROM reg_conference_company@webtst rcc
    , reg_conference@webtst rc
    , reg_conference_type@webtst rct
    , reg_session@webtst rs
    , reg_session_t@webtst rst
    , locale@webtst l
    , reg_special_fee@webtst rsf
    WHERE rcc.reg_conference_id = rc.ID
    AND rc.reg_conference_type_id = rct.ID
    AND RC.ID = RS.REG_CONFERENCE_ID
    AND rs.ID = rst.reg_session_id
    AND rst.locale_id = l.ID
    AND l.language_id = '1'
    AND L.COMPANY = RCC.COMPANY
    AND rc.ID = rsf.reg_conference_id
    AND rcc.company = rsf.company
    AND (rsf.company || rsf.consultant_no) NOT IN
                                  (SELECT (company ||consultant_no)
                                  FROM reg_consultant@webtst
                                  WHERE status <> 'C'
                                  AND reg_session_id = rs.ID)
    --------------When i run this select i get 11 rows ----------------------------
    SELECT DISTINCT RCC.REG_CONFERENCE_ID
         , RCC.COMPANY
         , RC.REFERENCE_CODE
         , RCT.DESCRIPTION
         , RS.ID
         , RS.REFERENCE_CODE
         , RS.BEGIN_DATE
         , RS.END_DATE
         , RST.non_html_DESCRIPTION
         , rsf.consultant_no
         , rsf.fee_amount
         , rsf.reason
         , 'Y'
    FROM reg_conference_company@webtst rcc
         , reg_conference@webtst rc
         , reg_conference_type@webtst rct
         , reg_session@webtst rs
         , reg_session_t@webtst rst
         , locale@webtst l
         , reg_special_fee@webtst rsf
         , reg_consultant@webtst rcons
    WHERE rcc.reg_conference_id = rc.ID
    AND rc.reg_conference_type_id = rct.ID
    AND RC.ID = RS.REG_CONFERENCE_ID
    AND rs.ID = rst.reg_session_id
    AND rst.locale_id = l.ID
    AND l.language_id = '1'
    AND L.COMPANY = RCC.COMPANY
    AND rc.ID = rsf.reg_conference_id
    AND rcc.company = rsf.company
    AND rs.ID = rcons.reg_session_id
    AND rsf.company = rcons.company
    AND rsf.consultant_no = rcons.consultant_no
    AND rcons.status <> 'C'
    UNION
    --- consultants not registered and in special fee
    SELECT DISTINCT RCC.REG_CONFERENCE_ID
         , RCC.COMPANY
         , RC.REFERENCE_CODE
         , RCT.DESCRIPTION
         , RS.ID
         , RS.REFERENCE_CODE
         , RS.BEGIN_DATE
         , RS.END_DATE
         , RST.non_html_DESCRIPTION
         , rsf.consultant_no
         , rsf.fee_amount
         , rsf.reason
         , 'N'
    FROM reg_conference_company@webtst rcc
    , reg_conference@webtst rc
    , reg_conference_type@webtst rct
    , reg_session@webtst rs
    , reg_session_t@webtst rst
    , locale@webtst l
    , reg_special_fee@webtst rsf
    WHERE rcc.reg_conference_id = rc.ID
    AND rc.reg_conference_type_id = rct.ID
    AND RC.ID = RS.REG_CONFERENCE_ID
    AND rs.ID = rst.reg_session_id
    AND rst.locale_id = l.ID
    AND l.language_id = '1'
    AND L.COMPANY = RCC.COMPANY
    AND rc.ID = rsf.reg_conference_id
    AND rcc.company = rsf.company
    AND (rsf.company || rsf.consultant_no) NOT IN
                                  (SELECT (company ||consultant_no)
                                  FROM reg_consultant@webtst
                                  WHERE status <> 'C'
                                  AND reg_session_id = rs.ID)

    I don't know the reason, but here is what I would do to narrow the search for it.
    Remove all DISTINCT operators and replace UNION with UNION ALL. Compare the result (number of rows) for the select and for the View.
    If it is the same, then you have some problem with duplicate values. If not you have two different selects (compare execution plan too) or different data (does it run in the same schema?).
    Then add step by step a DISTINCT and check how the result changes. Start analyzing only this part of the query.

  • Odac 12.1 Oracle.VsDevTools Cannot edit query results

    I am running Windows 7 64-bit and Visual Studio 2010
    I installed ODTwithODAC121010 successfully.
    In Visual Studios Help>About it shows: Oracle Developer Tools for Visual Studio 12.1.0.1.0
    Issue:
    After updating to odac 12.1 I can no longer edit/insert data into the query builder results pane.
    I have relied on this capability in previous versions of odac.
    Has this feature been removed?
    I've connected to multiple Oracle 11g dbs with same results below:
    I get the following response when I attempt to edit a field in the query results pane:
    No row was updated.
    The data in row 10 was not committed.
    Error Source: .
    Error Message: Unable to parse expression.
    Correct the errors and retry or press ESC to cancel the change(s).
    I get the following response when I paste a new row in the query results pane:
    No row was updated.
    The data in row 11 was not committed.
    Error Source: Oracle.VsDevTools.10.0.
    Error Message: Object reference not set to an instance of an object.
    Correct the errors and retry or press ESC to cancel the change(s).
    Is there something I need to do to enable this?
    What are some good alternatives if this capability is no longer supported?

    Hi George Pertea,
    Thanks for the reply.
    I am in the edit query mode and also the query tool bar is enabled.
    But my "view sql" button is disabled,I cannot click on it.
    I am logged in as "Admin" , so what is the problem.
    I was able to do that in XI R2 before.
    Please help me!
    Thanks

  • Getting different behaviour when query hits a single row?

    Hi
    I have a page where people type in search conditions and when they see the results (an ordinary tabluar report) they can click a certain row to assign the key of that row to a hidden field in my page.
    There's a requirement that if they're clever enough to hit a single matching row, then the key of that row is assigned to my hidden item without them having to go through the stress and hard work related to clicking a link :-)
    So I'll probably make a process that tests to see if their search returns a single row and only do the report if not. But that means performing the resulting SQL twice when there's more than one row.
    Is there a way to have the number of rows returned by the SQL source for a report affect the behaviour of the page? AFAIK the #TOTAL_ROWS# etc. are only applicable in the header & footer of the report region, so I guess there's no way to do what I imagined?
    Jakob

    You could query your rows into a collection and determine the number of records in the collection. Check out the HTMLDB_COLLECTION (APEX_COLLECTION) API section in the HTML DB (APEX) documentation.
    Your multiple record region where they select their row could then be based on:
    SELECT * FROM HTMLDB_COLLECTION WHERE collection_name = 'my collection'
    Mike

  • Query Result Filtered using User Roles SCSM 2012 R2 RU2

    Hi,
    I have a Query Result setup in a Request Offering that shows the list of Printers using the Printer CI. We have different sites with printers that start with the site location like MTL. There are no filters in the Query Result. What i did is create a Group
    for each site that has the rule "start with" MTL (other groups have other 3 letter prefix). Then i created a user role for each group and only selected the Printer group for the site and i associated the User Role with our AD Site group called MTL-User.
    i did this for each site. Now when i checked the Request Offering at first, with a user that is part of MTL-User group, it showed only the list of printers that started with MTL. Now today i came to check again and the same user is seeing all the printers
    and not just the ones that start with MTL.
    The User Role i made was based on the Read-Only Operator. I just dont know what the problem is

    Thanks for that link. I had thought of something like that but i found it came to the same thing as just using the filter field that is already available when using a Query Result. I retried using User Roles and figured out that the problem is that my test
    user is only part of the MTL-USER group so when i logged in with him into the portal (cireson Portal btw) i would see the proper result. If i logged in with a actual user that is also part of other groups besides MTL-Users, they see all the printers no matter
    which AD group i define in the User Role. 
    So what i figured was that my group is not getting applied as the filter to the query Result and that the Member section in the User role is only to say who can see the Query result list. But then i have my test user for which this setup works...so im confused
    on what exactly is overriding the results.

  • How can I export the query result into access(*.mdb) file?

    Dear all:
    I want to export the query result displayed in jsp into excel file
    and access file. And I have exported the result into excel format successfully, only one line should be added in the head of Jsp:
    <%@ page contentType="application/vnd.ms-excel; charset=gb2312" %>
    But how can I export it in access(*.mdb) file? I have replaced "excel"
    with "access". But it can't achive my goal.
    What should I do to achieve my goal?
    Thanks!

    The only reason your Excel export works is that Excel knows how to interpret comma separated values as an input file format. Access has no such beast.
    If you absolutely must provide info in an mdb, one solution would be to create an ODBC datasource pointing to an empty mdb, then push data into it using the jdbc:odbc bridge, then make a copy of the file and stream it down to the browser. You may run into some ugly file locking items here - set the ODBC connection so it is not shared, and that might help.
    This one is going to be ugly.
    I suppose another approach would be to write a simple VB applicatin that uses automation to create an MDB, then stream that file down to the browser from your servlet. That would almost certainly be faster than the ODBC approach.
    - K

  • Put query result in cells like

    hi how do you
    Put query result in cells like
    Table:
    ROWS AND COLUMNS in cells / grids.
    just like an excel sheet but in html result?
    thanks

    this is the tutorial code.
    where do i put the code here to make the cells/record like?
    thanks!
    <cfquery name="Myqueryname"
    datasource="#Request.MainDSN#">
    SELECT
    CompanyID,
    CompanyName,
    Address,
    City,
    State,
    ZipCode,
    Comments
    FROM
    Company
    ORDER BY
    CompanyName ASC
    </cfquery>
    <html>
    <head>
    <title>CF TUTORIALS</title>
    <link rel="stylesheet" href="styles.css">
    </head>
    <body>
    <h1>All CO Listings</h1>
    <table>
    <tr>
    <td><b>ID</b></td>
    <td><b>Name</b></td>
    <td><b>Address</b></td>
    <td><b>City</b></td>
    <td><b>State</b></td>
    <td><b>ZIP Code</b></td>
    <td> </td>
    </tr>
    <cfoutput query="Myqueryname">
    <tr>
    <td>#CompanyID#</td>
    <td>#CompanyName#</td>
    <td>#Address#</td>
    <td>#City#</td>
    <td>#State#</td>
    <td>#ZipCode#</td>
    <td>
    <a href=" ALL Emps.cfm?CompanyID=#CompanyID#">ALL
    Emps</a>
    <a href=" AddCO Form.cfm">AddCO</a>
    <a href="
    Editco.cfm?CompanyID=#CompanyID#">Editco</a>
    <a
    href="CoDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
    </td>
    </tr>
    </cfoutput>
    </table>
    </body>
    </html>

  • Extract SQL Query Results to 'xlsx' bogs down at 150,000 rows

    Environment:
    SQL*Developer 3.1.07.42 on Windows XP SP3
    Oracle 11.2.0.3 EE on Solaris 10.5
    I ran a query in a worksheet window and the first page of results came back in 10 seconds, whoo hooo!
    I right-clicked the first column in the first row and selected 'Count Rows' and it returned 527,563 after thinking a bit.
    I right-clicked 'Export', selected a format of 'xlsx', unchecked the box for 'Query Worksheet Name' and browsed to specify the output file directory (my local C: drive) and file name. I clicked 'Next' and then 'Finish'.
    I watch the row counter at the bottom right of the window and it went very fast until it hit about 150,000 rows and then it started slowing down. It got slower and slower and slower and slower, well you get the picture, and I finally killed the process when it took over 15 seconds to get from 156,245 to 156,250.
    Why would this be?
    Additional information:
    I ran the exact same query again and exported the same 527,563 rows using the 'xls' format instead of 'xlsx' and the process proceeded very quickly all the way to the end and completed successfully in just several minutes. The resultant spreadsheet contained eight (8) worksheets since it could only put 65536 rows into each worksheet. This was acceptable to the user who simply merged the data manually.
    Is there some issues with using 'xlsx' as the output format as opposed to just using it as an input format?
    Does SQL*Developer try to create a spreadsheet with as many rows as the data up to the max in Excel 2010 (which is more than 527,563)?
    Thanks very much for any light shed on this issue. If I've left out any important details please let me know and I'll try to include them.
    -gary

    Hi gary,
    You may have already seen one or more threads like the following on the issue of increased memory overhead for the Excel formats:
    Re: Sql Developer 3.1 - Exporting a result set in xls generates and empty file
    Basically SQL Developer uses a third-party API to read and write these Excel formats. There are distinct readers and formatters for each of the xls and xlsx forms.
    There is a newer version of the API that supports streaming of xlsx Workbooks. Basically it achieves a much lower footprint by keeping in memory only rows that are within a sliding window, while the older, non-streaming version gives access to all rows in the document. The programmer may define the size of this window. I believe the newer API version was either not available or not stable during our 3.1 development cycle. Possibly a future SQL Developer version might use it.
    Regards,
    Gary
    SQL Developer Team

  • How can I get Numbers to return the first row in a group of VLOOKUP query results instead of last one?

    I'm trying to query from one table (call it Table1) a batch of rows in another table (Table2) using VLOOKUP on a date specified in the first table (Table1). My problem is it's returning the last incident in Table2 of the requested date instead of the first incident. This really breaks the OFFSET scheme I'd like to use to collect the rest of the items for that date. Is there some way to compel VLOOKUP to return the first row of query results, not the last?
    NOTE: I see I've asked this before, but forgot to go back and look at responses given. It's been a while and I've limped along until now with the way things were. I'm actually trying to delete this questions, so if you see it, ignore it. I suppose if someone can tell me real quick how to delete a stupid question, that might be helpful.

    you cannot delete a post yourself.  You can flag the post an request a moderator remove.

Maybe you are looking for

  • Random characters get pressed and random mouse movements happen automatical

    No idea what's going on, but this has been happening randomly for awhile. Random commands will get pressed, as if they are coming from my keyboard (I see the 'echo' command a lot) and my mouse will move to random places. It will last for awhile, and

  • Failure to call jdoPreClear 2.3 RC1

    Hi guys, When a persistent-deleted instance is processed in commit, the jdoPreClear method is not being called when RetainValues is false. (Ditto I suspect for persistent-new-deleted.) In the spec section 5.5.6 makes it clear that the fields should b

  • How do i fix a bad esn?

    So my cousin gave me his iphone 5 and it was working fine until like week when it was block for " lost " . How can I fix this? I` have the receipt and everything.

  • Create OS X Default Profile/Template & Bind to AD (10.6 & 10.5)

    This article will explain how to create a default user profile/template for OS X 10.6 Snow Leopard & OS X 10.5 Leopard as well a quick overview of how to bind your Mac to AD (Active Directory) Why create a Default profile/template? If you a computer

  • How to use an SWF and XML in PDF?

    Hi I am publishing a PDF from Adobe RoboHelp (version 10, part of TCS 4). I have inserted some Flash-based SWF files whose text content is called from an XML file. Now, when I publish the RoboHelp project as an HTML output, and place the XML file in