Getting data from view object into backing bean

Hi,
My requirement is explained below -
     I have a ADF editable table in a jsf page which is connected to backend database table. In the table there are 6 columns and only 2 are editable. So when user inputs a value in first input column an event is triggered such that the data for all the remaining columns should be fetched from another database table.
Typically if we are not using ADF development environment. We would have had a simple business method which creates the sql query by taking the input from textbox with simple where clause and I would have got the data. I am not getting any idea how to do this in ADF. I have the second table as view object but how to access the view object from backing bean and get data based on the input given.

Hi,
step 1) Expose a method on the ViewObject Impl class
step 2) define arguments for the method as needed to identify the row to read data from
step 3) retrieve the row from the VO that holds the data you want to add and return a HashMap with this information
step 4) expose the method on the client interface (Java menu selection on the View Object)
step 5) In the PageDef file, create a method binding to the method you exposed on the ViewObjectImpl
step 6) Call the method binding from the managed bean like
OperationBinding getDataFromVO = (OperationBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("Name of method binding);
getDataFromVO.getParamsMap().put("name of arguments1", value1);
getDataFromVO.getParamsMap().put("name of arguments2", value2);
Object retData = getDataFromVO.execute();
if(retData != null && getDataFromVO.getErrors().size()==0){
  HashMap retDataMap = (HashMap) retData;
... follow the rest of your logic ....
Frank

Similar Messages

  • How to access query based view object in backing bean

    Hi
    I am using JDev11.1.2.1.0
    I want to use the query result of query based view object in backing bean.
    How can i do the same
    Please Solve this
    Thanks

    Hi,
    Assuming ADF is in the picture
    1. Create a PageDef file for the page (right mouse click "Go to Page Definition")
    2. In the Executable section, create an iterator for the View Object
    3. In the managed bean:
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    DCIteratorBinding iter = (DCIteratorBinding ) bindings.get("name of Iterator");
    iter.execute();
    // ... navigate the iterator rows ...//
    Frank

  • Get data from view and displaying the table data into Excel  pivot table

    Hi All,
    I have a small reqirement inthat When i get the data from the View that would displayed as Excel Pivot table.
    For displaying gerneral data to Excel I have followed Binarcy cachey
    Please suggest me in this.
    Thanks,
    Lohi.
    Message was edited by:
            Lohitha M

    Try this:
    http://download-west.oracle.com/docs/html/B25947_01/bcservices005.htm#sthref681
    Specifically code sample 8-10 for accessing the AM object.
    Then use the findView method to get a pointer to the VO.

  • Using EL to get values from View Objects

    Hello again!
    I' m using jdev 11.1.1.4.0, with adf and business components
    Is there any way i can get a value to an af:outputText from a view object's field without
    a) having to expose all fields that I need in bindings tab?
    b) having to declare all fields to a backing bean
    I have a statistical table with about 30 numbers in a record and it would make my project impossible to follow!
    Some EL on the af:outputText with a parameter to a function on my backing bean, would sound perfect, but I've read that it's impossible...
    Any clues?
    Thank you for your efforts!
    Nikos

    I did not understand you.
    will the drag and drop your attribute on your page will solve your problem?
    or do you need to create attributeValues biding for single attribute? if yes do the following:
    1- From your page, right click and select Go to Page Definition.
    2- From the binding section, click the plus green icon to create a new control biding, and choose attributeValues from the list.
    3- select your data source from the list or create a new one, then select the attribute you need.
    4- now you have a biding, and you can set the value for your output text.
    value =#{biding.yourAttribute.inputValue}

  • Modifying where clauses for View Objects in Backing Beans

    In studying the RichTable class I saw no get/set methods that would allow me to manipulate the underlying view instance and rowset for the table in the Backing Bean. I know there is a way to do it, but I having great difficulty in finding it. The tutorials show how to build view objects and display them, but I haven't seen a tutorial that show how to respond to events from the Web page and directly change the data model and what is displayed via the backing bean.
    Can some one point to a tutorial or give me an example on how I can change a view object via a backing bean?

    What you want to do is add a method to your View Object Implementation class that changes the WHERE clause with setWhereClause or addWhereClause. Expose the method to your client. Then call the method from your page by binding it to a commandButton or commandLink. You can bind it through a pageDef file or a backing bean.

  • Getting data from on object!!

    Hello!
    Well I'm having a problem when I try to get the data from a class i my jsp page.
    I have a database conection class and methods to conect to tha database and get the data :
    package teste;
    public class Data {
        Connection con;
        Detalhes detalhes;
        ArrayList list;
        public Data()throws Exception {       
            try {
                Class.forName("org.gjt.mm.mysql.Driver");
                con = DriverManager.getConnection("jdbc:mysql://127.0.0.1/Loja?user=root&password=131283");            
            } catch (Exception ex) {
                throw new Exception(" Database not found!!" +
                    ex.getMessage());
        public void remove() {
            try {
                con.close();
            } catch (SQLException ex) {
                System.out.println(ex.getMessage());
        public Detalhes getDetalhes(int codigo){
            try {
                String selectStatement = "select * from produto where codigo="+codigo;
                PreparedStatement prepStmt = con.prepareStatement(selectStatement);
                ResultSet rs = prepStmt.executeQuery();
                while(rs.next())
                     detalhes = new Detalhes(rs.getString(1), rs.getString(2), rs.getDouble(3), rs.getInt(4));          
            }catch(Exception e){
                return detalhes;
        public ArrayList getList(){
            try {
                String selectStatement = "select * from produto";
                PreparedStatement prepStmt = con.prepareStatement(selectStatement);
                ResultSet rs = prepStmt.executeQuery();
                while(rs.next())
                     detalhes = new Detalhes(rs.getString(1), rs.getString(2), rs.getDouble(3), rs.getInt(4));          
                     list.add(detalhes);
            }catch(Exception e){
                return list;
    }    i have too, a context class to put the database conection avalaible:
    package teste;
    public final class ContextPage implements ServletContextListener {
        private ServletContext context = null;
        Data dados;
        public void contextInitialized(ServletContextEvent event) {
            context = event.getServletContext();
            try {
                dados = new Data();
                context.setAttribute("bookDB", dados);
            } catch (Exception ex) {
                System.out.println("Couldn't create bookstore database bean: " +
                    ex.getMessage());
        public void contextDestroyed(ServletContextEvent event) {
            context = event.getServletContext();
            Data dados = (Data) context.getAttribute("bookDB");
            if (dados != null) {
                dados.remove();
            context.removeAttribute("bookDB");              
    }I have too a class with methods to store and show the data that i'd got from the conection class:
    package teste;
    public class Detalhes {
        String titulo, autor;
        Double preco;
        int codigo;
        public Detalhes(String titulo, String autor, Double preco, int codigo) {
            this.titulo = titulo;
            this.autor = autor;
            this.preco = preco;
            this.codigo = codigo;
        public String getTitulo(){
            return titulo;
        public String getAutor(){
            return autor;
        public Double getPreco(){
            return preco;
        public int getCodigo(){
            return codigo;
    }and the last class is to intermediate the data flow between Data.class and Detalhes.class.
    package teste;
    import java.util.ArrayList;
    public class GetData {
         Data db;
         int codigo;
         Detalhes detalhes;
         public GetData() {       
        public void setCodigo(int codigo){
            this.codigo = codigo;
        public void setDb(Data db){
            this.db = db;
        public Detalhes getDetalhes()throws Exception{
            detalhes = (Detalhes)db.getDetalhes(codigo);
            return detalhes;
        public ArrayList getList()throws Exception{
            return db.getList();
        public void remove() {
            db.remove();
    }and the piece of my page with proble is
    <p><b><h1>Resultado:</h1></b></p><br>
    <jsp:useBean id="dados" class="teste.GetData" scope="page">
          <jsp:setProperty name="dados" property="db" value="${dados}"/>
    </jsp:useBean>    
    <jsp:setProperty name="codigo" property="db" value="1"/>So the problem is that when i acess this page i get an error message
    could you geve me some advice with some code?
    the exception is:
    org.apache.jasper.JasperException: Attempt to coerce a value of type "teste.GetData" to type "teste.Data"
         org.apache.jasper.runtime.JspRuntimeLibrary.handleSetPropertyExpression(JspRuntimeLibrary.java:659)
         org.apache.jsp.Resposta_jsp._jspService(Resposta_jsp.java:53)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)I thank you very much for this help!! All the best!!

    Thanks for trying to help me, but I just have done this:
    <jsp:useBean id="gDados" class="teste.GetData" scope="page">
          <jsp:setProperty name="gDados" property="db" value="${dados}"/>
    </jsp:useBean>    
    <jsp:setProperty name="codigo" property="db" value="1"/>
    <p><b><h1>${gDados.detalhes.titulo}</h1></b></p><br>and it brings me the excption :
    org.apache.jasper.JasperException
         org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:365)
         org.apache.jasper.runtime.JspRuntimeLibrary.access$000(JspRuntimeLibrary.java:60)
         org.apache.jasper.runtime.JspRuntimeLibrary$PrivilegedIntrospectHelper.run(JspRuntimeLibrary.java:90)
         java.security.AccessController.doPrivileged(Native Method)
         org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:306)
         org.apache.jsp.Resposta_jsp._jspService(Resposta_jsp.java:60)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)have youany other suggestion?Thanks!!

  • Push messages from business logic into backing bean

    In my simple web application a table with the contents of a database table is shown to the client. Now I want this table in the browser to be updated each time the db table is updated. In my business logic a jms message is fired to a specified topic each time the db table is updated. The reverse ajax stuff needed for the client update is provided by the Icefaces jsf implementation. There is a backing bean for each session which is responsible for the server side rerendering of the client. Now my question is: How do I connect the bussiness logic firing a jms message if the db table is updated, with the backing bean?
    My thoughts:
    1. Create a message listener for the topic. Each time the message listener receives a message it notifies the backing beans of each session to rerender the client. But how does the message listener know about the backing beans?
    2. The backing bean responsible for rerendering the client adds itself as a listener. But where? As I understand it cannot be a backing bean and a jms MessageListener at the same time.
    Has anyone an idea/pattern for this problem?

    You could keep a list of beans that need to be notified in the application scope. (You should probably use weak references so that they may be garbage collected.) Then you JMS listener could get access to them.
    Somebody posted a thread recently where they were doing something very similar, you might want to try to find it.

  • How to get data from MS CRM into Crystal Reports

    Hello All,
    Can anybody tell me how to get data into   crystal XI reports with MS CRM.
    Thanks in Advance
    Ramesh

    First you should refer to the Rules of Engagement and then add more info.
    Start off by telling us what version of CR are you using and what is MS CRM?
    Thank you
    Don

  • How to sort view object in backing bean

    Hello all ,
    I want to dispaly read only table in sortable way depending on one of attribute value.
    in backing bean I am trying to execute query by executeQuery method but it didn't work
    I have put column sort property to true but it does not work..
    please help me..
    I am using Jdevloper 11.1.1.2.0
    If any one required more details please post

    Hi,
    One way to achieve this is, add a method in your vo which does something like this
      public void customSortBy(String columnName){
      this.setOrderByClause(columnName);
      this.executeQuery();
      }Expose this method as client interface and add it to your pagedef as method binding.
    Once you are done, you can execute method from backing bean by passing the sorting parameter according to your need.
    -Arun

  • What is the best way to get data from a spreadsheet into an HTML table?

    I am using libreoffice, and I have it set to collate all the information I enter and output it to a simple table within the program like this:
    http://imageshack.us/a/img717/5144/spreadsheeta.jpg
    I want to get this information after sorting it and put it into the following html table within dreamweaver:
    http://imageshack.us/a/img28/8872/htmls.jpg
    what is the best method for getting the info from A to B?

    before:
    <table id="tbl-m">
              <tr class="tbl-hd">
                <td class="tbl-pos-width">pos</td>
                <td class="tbl-team-width">team</td>
                <td class="tbl-p-w-d-l-p">pld</td>
                <td class="tbl-p-w-d-l-p">won</td>
                <td class="tbl-p-w-d-l-p">drwn</td>
                <td class="tbl-p-w-d-l-p">lost</td>
                <td class="tbl-p-w-d-l-p">pts</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">1</td>
                <td class="tbl-team-width">Team Name 1</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">2</td>
                <td class="tbl-team-width">Team Name 2</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">3</td>
                <td class="tbl-team-width">Team Name 3</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">4</td>
                <td class="tbl-team-width">Team Name 4</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">5</td>
                <td class="tbl-team-width">Team Name 5</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">6</td>
                <td class="tbl-team-width">Team Name 6</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">7</td>
                <td class="tbl-team-width">Team Name 7</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">8</td>
                <td class="tbl-team-width">Team Name 8</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">9</td>
                <td class="tbl-team-width">Team Name 9</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">10</td>
                <td class="tbl-team-width">Team Name 10</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">11</td>
                <td class="tbl-team-width">Team Name 11</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">12</td>
                <td class="tbl-team-width">Team Name 12</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">13</td>
                <td class="tbl-team-width">Team Name 13</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">14</td>
                <td class="tbl-team-width">Team Name 14</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">15</td>
                <td class="tbl-team-width">Team Name 15</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">16</td>
                <td class="tbl-team-width">Team Name 16</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
            </table>
    after:
    <table>
              <tr>
                <td>Pos</td>
                <td>Team</td>
                <td>Pld</td>
                <td>Won</td>
                <td>Drwn</td>
                <td>Lost</td>
                <td>Pts</td>
              </tr>
              <tr>
                <td>1</td>
                <td>Team 1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>2</td>
                <td>Team 2</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>3</td>
                <td>Team 3</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>4</td>
                <td>Team 4</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>5</td>
                <td>Team 5</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>6</td>
                <td>Team 6</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>7</td>
                <td>Team 7</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>8</td>
                <td>Team 8</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>9</td>
                <td>Team 9</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>10</td>
                <td>Team 10</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>11</td>
                <td>Team 11</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>12</td>
                <td>Team 12</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>13</td>
                <td>Team 13</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>14</td>
                <td>Team 14</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>15</td>
                <td>Team 15</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>16</td>
                <td>Team 16</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
            </table>

  • Getting data from CTE's into existing table

    Hello,
    I don't understand what is wrong with following query, when I search on the net I find simular sql statements .... my cte works (tested seperately), I've used the for loop just to copy from one table to another ... but when I combine them it goes wrong...
    The code that is in commet are some variations I have tried.
                with x as (
                  select 
                    p.id as id, p.naam as pers , c.id as comp, cp.sectorid as sect
                    from competentiepersoon cp
                        join persoon p on p.id = cp.persoonid
                        join competentie c on c.id = cp.competentieid
                        where sectorid = 14 --c1.id
                y as (   
                    select t1.comp as comp1, t2.comp as comp2, t1.sect, count(*) as tel
                        from x t1, x t2
                        where t1.comp != t2.comp
                          and t1.id = t2.id
                        group by t1.comp, t2.comp, t1.sect
                z as (
                      select
                        comp1, comp2, sect, tel / (select count(*) from y  where comp1 = y1.comp1 or comp2 = y1.comp1 or comp1 = y1.comp2 or comp2=y1.comp2 ) as match
                      from y y1
              --insert INTO competentiematching(competentieid1, competentieid2, sectorid, matching)
             --values select comp1, comp2, sect, match from z;
           for toInsert in ( select * from z )
              loop
                   insert into competentiematching values(toInsert.comp1, toInsert.comp2,toInsert.sect,toInsert.match);
            end loop;  => keeps giving "missing select statement"
    ps sorry for my english :).

    Hi,
    There is no need to use a LOOP, or even PL/SQL: you can just do an INSERT statement like this:
    insert into competentiematching     (...)     -- List of columns isn't strictly required, but it's a good idea
    with x as (
                  select 
                    p.id as id, p.naam as pers , c.id as comp, cp.sectorid as sect
                    from competentiepersoon cp
                        join persoon p on p.id = cp.persoonid
                        join competentie c on c.id = cp.competentieid
                        where sectorid = 14 --c1.id
                y as (   
                    select t1.comp as comp1, t2.comp as comp2, t1.sect, count(*) as tel
                        from x t1, x t2
                        where t1.comp != t2.comp
                          and t1.id = t2.id
                        group by t1.comp, t2.comp, t1.sect
                z as (
                      select
                        comp1, comp2, sect, tel / ( select count(*)
                                                 from y 
                                    where comp1 = y1.comp1
                                    or      comp2 = y1.comp1
                                    or     comp1 = y1.comp2
                                    or     comp2 = y1.comp2
                                   ) as match
                      from y y1
    SELECT  ...        -- Main query goes here
    ;There was no main query after the sub-query y1 in the code you posted.
    An INSERT statement like the one above will work in SQL or in PL/SQL.
    If you do need to use a loop, then the syntax is:
    FOR  toInsert  IN ( <query> )
    LOOP
    END LOOP;Where I wriote <query> above, you should put the entire query, starting with the keyword WITH when it is used. For example:
    FOR  toInsert  IN (
                                with x as (
                                  select 
                                           p.id as id, p.naam as pers , c.id as comp, cp.sectorid as sect
    LOOP
    END LOOP;

  • How get data from business object to xml file

    Hi all,
    My new problem is ,,
    In my application, I have check list of selected business partners. In that , I want to save the checked oBusinessPartners complete information to an XML file(created dynamically),
    How to do?
    Thanks in advance
    shashi kiran

    Shashi Kiran,
    Can you explain me detail where
    you want to save check business partners in xml ?
    Jeyakanthan

  • Without NI DAQ device- how to get data from MSP into labVIEW and process it

    Hi,
    I do not have an NI DAQ device. I have an MSP430 and my sensor is an ADXL335 Accelerometer. How do I get data from my MSP into labVIEW and process it?
    Just looking for a nudge in the right direction. I'm having a hard time finding resources on labVIEW that don't involve NI specific DAQs. 
    Thanks in advance,
    Aziz

    There are many ways to get data into LabVIEW that do not involve NI-DAQ devices.
    I think your easiest option would be to stream it via serial port if the data rate isn't too fast.
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle

  • Clarification on details regarding getting data from APO into BW

    Hi Friends,
    I need some clarification in terms of getting data from APO into BW for reporting:
    I observed that SAP has provided standard data flows for PPDS module, where as for the Demand Planning and Supply Network Planning SAP has just provided some standard InfoCubes ex: 0APO_C07, 0APO_C10, 0APO_C11, 0APO_C12.
    Which makes me believe that for Demand Planning and Supply Network Planning we need to generate DataSources from the Planning books in DP & SNP and build our own custom data flows. In that case what is the use of above mentioned InfoCubes provided by SAP?
    Also in my current project the client has built a custom DataSource on top of a Planning Book in DP and created custom data flow in BW for reporting and also created a Back up cube in APO.
    My question on this is, what is the use of this Back up cube in APO, what is the need to maintain two same cubes in two different systems?
    My next question is, I have installed complete data flow for 0APO_C02 (Orders Data) in BW and loaded data. In SAP documentation it says when we try to load data for a particular date range using this InfoSource (0APO_PPDS_ORDER_01), it directly loads data from the live cache.
    Is there a way to know if the data is coming from Live Cache or from APO server, can we get data from live cache for 9A*** Datasources also, which we create on planning books in DP and SNP?
    Any comments and Info will be greatly appreciated. Thanks!

    Hi Sunitha, thanks for your inputs. So does that mean for Demand Planning and Supply Network Planning, SAP has not given any standard DataSources because it makes more sense to build DataSources from the planning books as each company has their own planning strategies based on how they do there business. Right?
    And for these modules there is no other way rather than generating DataSources from Planning Books and build the Data Flows based on it. Right?
    Also these generated DataSources i.e. 9A**** pull data from live cache itself right or is there any setting that we need to enable for it to get data from live cache?
    Thanks again for your valuable inputs hope to get answers to above questions as well.

  • Can we get data from business views  in CR 2008/XI?

    Hi All,
    Can we get data from business views  in CR 2008/XI?
    If its possible, pls let us know how to get connect with Business View in both of these versions and what is the tool that we have to use to create Business Views.
    Thank you,
    Krishna Pingali

    Hi Krishna,
    Crystal Reports/BusinessObjects Enterprise ( BOE ) Business Views can only be created using the BV build which comes with BOE and installed using the Work Station installer for BOE. for both XI and 2008.
    You cannot mix these two versions on the same PC not can one talk to the other, the BV designer must match the same version as BOE. XI ( version 11.0 ) is no longer available but if you mean XI R2 ( version 11.5 ) then it still is.
    It's not completely clear which Business View you are referring to? BOE has a Business View Designer so not sure if this is just a naming problem or not? If you are referring to the BOE Business View Designer then the above is true. If your reference is about some other BV designer or data source then you need to clarify.
    Contact our Sales department for pricing and availability.
    Thank you
    Don

Maybe you are looking for

  • Merged Projects Not Appearing in WebHelp TOC

    Following the instructions on the Grainge site, I created a merged project with the following folder structure:' BAM\parent --->parent project location BAM\Child\Project1 --->child location BAM\Child\Project2 --->child location BAM\Child\Project3 ---

  • Color is faster on slower machine.  Is it Leopard?

    So, maybe I'm jumping to conclusions here, but let me lay the facts out. I rendered the same material in Color on two different machines. One: a dual 2.3 Ghz G5 with 3GB of RAM. And the other: a dual 2.0Ghz G5 with 1.5GB of RAM. Both have the same Ra

  • I rented a movie and my laptop got an update and i dont have the movie

    yesterday(June 11) i rented the movie Juno and i was out in my living room watchin a movie and my laptop got an update when i was gone and it restarted, i woke up today and i was going on iTunes to watch the movie and it was gone

  • How do I get a Download icon into my dock?

    I used to be able to see a folder of Downloads in my dock.  It isn't there anymore and I want to get it back.  I tried to go into Applications and look for a Download icon to drag into the dock, but I didnt see anything called Downloads.  Any suggest

  • Reopened Sales Order Status

    Hi all How to trace whether Sales Order is Reopened with Open Status? Kedalene Chong