Populate table with refresh group outcome

Hi everyone,
I need a little help.
I am working on an Oracle 10.2.0.4 in Windows environment.
I have a table I created like this:
Table name: DIM_REPLICA
COD_SEZ VCHAR2(2)
NOME_SEZ VCHAR2(20)
FLAG CHAR(1)
D_REPLICA DATE
On this DB I have 210 refresh groups executing every night. I need to populate this table with the outcome of the refresh groups.
So when the refresh group called for example ROME runs I need written on the table the name ROME in the "NOME_SEZ" field, a Y or a N if the refresh group worked correctly in the FLAG field and the LAST_DATE the refresh group ran in the D_REPLICA field. The COD_SEZ field is a code I get from other things. It is not needed at the moment. I can add it myself on me own.
Can anyone please help me?
I was looking on SYS tables DBA_JOBS and DBA_REFRESH for this data, but I am not sure what to take and how to populate the table. Trigger? Procedure? Any help will be great!
Thank you all in advance!

Hi Phelit,
After update trigger may help you with few customization
Refer sample code
CREATE OR REPLACE TRIGGER orders_after_update
AFTER UPDATE
   ON orders
   FOR EACH ROW
DECLARE
   v_username varchar2(10);
BEGIN
   -- Find username of person performing UPDATE into table
   SELECT user INTO v_username
   FROM dual;
   -- Insert record into audit table
   INSERT INTO orders_audit
   ( order_id,
     quantity_before,
     quantity_after,
     username )
   VALUES
   ( :new.order_id,
     :old.quantity,
     :new.quantity,
     v_username );
END;Thanks,
Ajay More
http://www.moreajays.com

Similar Messages

  • Populate table with XML returned by a Web Service

    Hi,
    I have a web service that executes MulitipleRowQuiery and returns XML
    variable.
    When I set the data connection (in Designer) to this service in my
    PDF form I'm getting "document" and "element" nodes under the
    invokeResponce tree (data view palette).
    How can I use this parameters in order to traverse the XML that was
    returned by the WS?
    What I need is to populate a table with this XML data..
    Thanks, Rbuz.

    You can use the XDP as is ...it is just this forum that will not accept XDP format. I have already made th erequest to get it changed and we are waiting for the next software update.
    There are two sets of bindings for every object on a form. DataBindings allow you to import XML and bind the nodes to the fields and Execute bindings which are used with Web Services. I used your sample XML file as an input for data bindings and got it to work the way you want by using [*] in the binding instructions to indicate that more than one node was present there. This is not possible in the Execute bindings. You can only have a one to one relationship. So I do not think you can do it the way you want.
    Can you get the WS to return you the entire XML as a single parameter? If so then you could bind that parm to a hidden field, then load all of the XML into the DataDom and use Data Bindings that do support what you are trying to do. I have included a sample that shows the table being filled the way you want using data binding.
    You shoudl contact support and get an enhancement logged to get the WS bindings to act the same way.
    Hope that helps
    Paul

  • Numbering table with parent grouping

    Hi, i have a table that i grouped by email in ssrs, and i would like to insert a row number, that will be by the parent grouping
    i tried using a solution from another question.
    ;with cte as
    (select *,dense_rank() over(order by row1) as rowID
    from @table
    select * from cte
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/078e45e5-edbf-4451-a5d2-bcf2f0382353/how-to-make-a-grouped-row-number?forum=transactsql
    but i was not able to get it working. this was the query i used to prepare the table
    SELECT        FirstName, LastName, EmailAddress, tused, CourseTitle, lastlogindate, Noofmodules, COUNT(coursecompleted) AS modulesstarted, 
                             REPLACE(REPLACE(REPLACE('<' + STUFF
                                 ((SELECT        ',' + CAST(CourseModule AS varchar(20)) AS Expr1
                                     FROM            edsf1
                                     WHERE        (FirstName = e.FirstName) AND (LastName = e.LastName) AND (coursecompleted = '1') AND (CourseTitle = e.CourseTitle)
    FOR XML PATH('')), 1, 1, ''), 
                             '<Expr1>', ''), '</Expr1>', ''), ',', '') AS CoursesCompleted
    FROM            edsf1 AS e
    WHERE        (coursecompleted = '1') OR
                             (coursecompleted = '0')
    GROUP BY FirstName, LastName, EmailAddress, CourseTitle, lastlogindate, Noofmodules, tused

    Sorry 
    not fully clear
    sounds like this
    SELECT DENSE_RANK() OVER (ORDER BY EmailAddress),
    FirstName, LastName, EmailAddress, tused, CourseTitle, lastlogindate, Noofmodules, COUNT(coursecompleted) AS modulesstarted,
    REPLACE(REPLACE(REPLACE('<' + STUFF
    ((SELECT ',' + CAST(CourseModule AS varchar(20)) AS Expr1
    FROM edsf1
    WHERE (FirstName = e.FirstName) AND (LastName = e.LastName) AND (coursecompleted = '1') AND (CourseTitle = e.CourseTitle) FOR XML PATH('')), 1, 1, ''),
    '<Expr1>', ''), '</Expr1>', ''), ',', '') AS CoursesCompleted
    FROM edsf1 AS e
    WHERE (coursecompleted = '1') OR
    (coursecompleted = '0')
    GROUP BY FirstName, LastName, EmailAddress, CourseTitle, lastlogindate, Noofmodules, tused
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page
    it works in sql server when i run the query, it assigns the row number to the right person. but when i try to use it in ssrs query, i get 
    The OVER SQL construct or statement is not supported.
    Make it into proc like this
    CREATE PROC ProcName
    AS
    SELECT DENSE_RANK() OVER (ORDER BY EmailAddress),
    FirstName, LastName, EmailAddress, tused, CourseTitle, lastlogindate, Noofmodules, COUNT(coursecompleted) AS modulesstarted,
    REPLACE(REPLACE(REPLACE('<' + STUFF
    ((SELECT ',' + CAST(CourseModule AS varchar(20)) AS Expr1
    FROM edsf1
    WHERE (FirstName = e.FirstName) AND (LastName = e.LastName) AND (coursecompleted = '1') AND (CourseTitle = e.CourseTitle) FOR XML PATH('')), 1, 1, ''),
    '<Expr1>', ''), '</Expr1>', ''), ',', '') AS CoursesCompleted
    FROM edsf1 AS e
    WHERE (coursecompleted = '1') OR
    (coursecompleted = '0')
    GROUP BY FirstName, LastName, EmailAddress, CourseTitle, lastlogindate, Noofmodules, tused
    Then in SSRS use below as command
    EXEC ProcName
    and it will work fine
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Table with column group (one column) - next row is showing on new page instead of below previous row

    I am creating new table. My goal is to display some text in few lines like this:
    "AAAAAAAA"           "BBBBBBBB"           "CCCCCCCCC"     
    "DDDDDDD"           "EEEEEEEE"
    Actually the next row (with "DD" and "EE" values) is not displayed below first row, but on the next page.
    I've tried to put table into rectangle, disabled all page breaks and still the same effect. Any help?

    Hi Heidi,
    Actually, it's not solution, I only gave more details about my problem :)
    Another description:
    In my report I'm creating Tablix with Column grouping. There is only one column with image (every image has same width). If there is only three pictures, then they are displayed next to each other in one row.
    In case, there is more than three pics, another row is showing on next page. I'd like to display all rows one after another on one page.
    I've tried to create three vertical lists, and filter each column group to display only records:
    1) =(RowNumber("Tablix1")) mod 3 = 1
    2) =(RowNumber("Tablix1")) mod 3 = 2
    3) =(RowNumber("Tablix1")) mod 3 = 0
    Unfortunately, I got an error:
    "A FilterExpression for the tablix ‘Tablix1’ uses the function RowNumber.  RowNumber cannot be used in filters."
    Do You have any other propositions?
    --------EDIT--------
    ok, I manged to solve it. As I said, I've created three vertival lists and placed them next to each other.
    Then, instead of using filter, I've used Visibility trigger:
    1)
    =IIf(RunningValue(Fields![rowgroupfield].Value, COUNTDISTINCT, "Tablix1") mod 3 = 1, false, true)
    2)
    =IIf(RunningValue(Fields![rowgroupfield].Value, COUNTDISTINCT, "Tablix2") mod 3 = 2, false, true)
    3)
    =IIf(RunningValue(Fields![rowgroupfield].Value, COUNTDISTINCT, "Tablix3") mod 3 = 0, false, true)
    I had to use function RunningValue to count all occurrences, as my report is quite complex and "RowNumber" [ssrs function] and "ROW_NUMBER() OVER (ORDER BY [rowgroupfield])" [sql query] were not working properly.

  • Populate table with date

    Hi,
    I a new to forms, using forms10g
    I want to populate a table based on the output of
    select to_number(to_char(last_day(sysdate), 'dd')) from dual;
    if result is 30 then
    30 row in the emp_att table but the att_dt should be from 01-Nov-06 and 30-Nov-06
    create table emp_att ( emp_code varchar2(10), att_dt date);
    How do I achieve this?
    Thanks

    Very nice statement! Thank you.
    Was experimenting with this a little.
    Strange thing that when ran it in sql*plus Oracle9i - it returns only ONE record.
    But, when I run
    create table x as (
    SELECT Trunc(SYSDATE,'MM') + LEVEL - 1 a
    FROM dual
    CONNECT BY LEVEL <= To_Number(To_Char(last_day(SYSDATE),'dd')))
    It inserts correctly 30 records.
    Than I tryed
    SELECT Trunc(SYSDATE,'MM') + x - 1
    FROM (SELECT LEVEL x FROM dual
    CONNECT BY LEVEL <= To_Number(To_Char(last_day(SYSDATE),'dd')))
    returns 30 records.

  • Populate table with repartitions

    Hello everyone,
    I would like some input on a problem to which I cannot seem to find a proper solution.
    I have five tables:
    Halls (_hall_, nr_places, nr_extra_places);
    Students (_id_student, name, major, year );
    Exams (year,major,id_subject,date_exam ,hour);
    Halls_exams (hall, date_exam, hour, id_subject);
    Repartition_exams (id_student, id_subject, date_exam, hour, hall);I’m trying to create a procedure or function to populate the fifth table (repartitions_exams) with students, repartitions for exams per halls and hours.
    It is important to keep in mind the number of places from each hall and at the same time, a hall must have students of the same year, major and id_subject, sorted alphabetically.
    I have tried solving this using a cursor but I failed in making it a viable solution.
    If you could give me any hints or possible solutions to this I would highly appreciate it.
    Thank you in advance,
    Ella
    -----edit
    these are the tables and inserts that I worked on...I apologize for any mistakes. I had to translate and to remove some columns that were irrelevant to the issue.
    create table halls(
    hall varchar(4) constraint pk_halls_hall primary key,
    nr_places numeric(4),
    nr_extra_places numeric(2)
    create table students(
    id_student varchar(20) constraint pk_students_id_student primary key,
    name varchar(30),
    year numeric(4),
    major varchar(20)
    create table exams(
    year numeric(4),
    major varchar(20),
    id_subject numeric(4),
    date_exam date,
    hour numeric(2),
    constraint pk_exams primary key(year,major,id_subject,date_exam)
    create table halls_exams(
    hall varchar(4) constraint fk_halls_exams_hall references halls(hall),
    date_exam date,
    hour numeric(2),
    id_subject numeric(4),
    constraint pk_halls_exams primary key(hall,date_exam,hour)
    create table repartition_exams(
    id_student varchar(20) constraint fk_repart_exams_id_student references students(id_student),
    id_subject numeric(4),
    date_exam date,
    hour numeric(2),
    hall varchar(4) constraint fk_repart_exams_hall references halls(hall),
    constraint pk_repart_exams primary key(id_student,id_subject,date_exam)
    insert into halls(hall,nr_places,nr_extra_places) values ('B1',10,2);
    insert into halls(hall,nr_places,nr_extra_places) values ('B3',10,2);
    insert into halls(hall,nr_places,nr_extra_places) values ('B4',12,2);
    insert into students(id_student,name,year,major) values ('pm095631','name1',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095632','name2',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095633','name3',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095634','name4',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095635','name5',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095636','name6',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095637','name7',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095638','name8',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095639','name9',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095640','name10',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095641','name11',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095642','name12',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095643','name13',2,'IE');
    insert into students(id_student,name,year,major) values ('pm095644','name14',2,'Ai');
    insert into students(id_student,name,year,major) values ('pm095645','name14',2,'Finances');
    insert into students(id_student,name,year,major) values ('pm095646','name15',2,'Ai');
    insert into students(id_student,name,year,major) values ('pm095647','name16',2,'Ects');
    insert into students(id_student,name,year,major) values ('pm095648','name17',2,'Ects');
    insert into exams(year,major,id_subject,date_exam,hour) values (2,'IE',115,TO_DATE('15/10/10','DD/MM/YY'),12);
    insert into exams(year,major,id_subject,date_exam,hour) values (3,'IE',125,TO_DATE('16/10/10','DD/MM/YY'),14);
    insert into exams(year,major,id_subject,date_exam,hour) values (1,'IE',135,TO_DATE('17/10/10','DD/MM/YY'),10);
    insert into exams(year,major,id_subject,date_exam,hour) values (3,'IE',145,TO_DATE('18/10/10','DD/MM/YY'),18);
    insert into halls_exams(hall,date_exam,hour,id_subject) values ('B1',TO_DATE('15/10/10','DD/MM/YY'),12,115);
    insert into halls_exams(hall,date_exam,hour,id_subject) values ('B3',TO_DATE('15/10/10','DD/MM/YY'),12,115);
    insert into halls_exams(hall,date_exam,hour,id_subject) values ('B4',TO_DATE('17/10/10','DD/MM/YY'),10,135);Edited by: user11973351 on Oct 6, 2010 5:49 AM
    Edited by: user11973351 on Oct 6, 2010 1:23 PM

    Ella,
    I think I understand what you're trying to do and the following example should work, but you may have to tweak it if some of my assumptions are incorrect.
    I used the row_number analytic function to assign a seat number to each student in an exam, and analytic sum functions to assign ranges of seat numbers to each hall for an exam. Then I selected students whose seat numbers were within those ranges.
    I ordered the students by id but you can order by name if you prefer. I also made an assumption that you want to assign the "extra" seats only after all regular seats have been assigned.
    I included the derived seat numbers and ranges in the output to make the logic easier to follow.
    Regards,
    Bob
    -- Generating test data...
    with halls as (
    select 1 as hall,10 as nr_places,2 as nr_extra_places from dual union all
    select 3 as hall,10 as nr_places,2 as nr_extra_places from dual union all
    select 4 as hall,12 as nr_places,2 as nr_extra_places from dual
    , students as (
    select 'pm095631' as id_student,'name1'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095632' as id_student,'name2'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095633' as id_student,'name3'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095634' as id_student,'name4'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095635' as id_student,'name5'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095636' as id_student,'name6'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095637' as id_student,'name7'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095638' as id_student,'name8'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095639' as id_student,'name9'  as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095640' as id_student,'name10' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095641' as id_student,'name11' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095642' as id_student,'name12' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095643' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095644' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095645' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095646' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095647' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095648' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095649' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095650' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095651' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095652' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095653' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095654' as id_student,'name13' as sname,2 as yr,'IE'         as major from dual union all
    select 'pm095644' as id_student,'name14' as sname,2 as yr,'Ai'         as major from dual union all
    select 'pm095645' as id_student,'name14' as sname,2 as yr,'Finances'   as major from dual union all
    select 'pm095646' as id_student,'name15' as sname,2 as yr,'Ai'         as major from dual union all
    select 'pm095647' as id_student,'name16' as sname,2 as yr,'Ects'       as major from dual union all
    select 'pm095648' as id_student,'name17' as sname,2 as yr,'Ects'       as major from dual
    , exams as (
    select 2 as yr,'IE' as major,115 as id_subject,TO_DATE('15/10/10','DD/MM/YY') as date_exam,12 as hour_exam from dual union all
    select 3 as yr,'IE' as major,125 as id_subject,TO_DATE('16/10/10','DD/MM/YY') as date_exam,14 as hour_exam from dual union all
    select 1 as yr,'IE' as major,135 as id_subject,TO_DATE('17/10/10','DD/MM/YY') as date_exam,10 as hour_exam from dual union all
    select 3 as yr,'IE' as major,145 as id_subject,TO_DATE('18/10/10','DD/MM/YY') as date_exam,18 as hour_exam from dual
    , halls_exams as (
    select 1 as hall,TO_DATE('15/10/10','DD/MM/YY') as date_exam,12 as hour_exam,115 as id_subject from dual union all
    select 3 as hall,TO_DATE('15/10/10','DD/MM/YY') as date_exam,12 as hour_exam,115 as id_subject from dual union all
    select 4 as hall,TO_DATE('17/10/10','DD/MM/YY') as date_exam,10 as hour_exam,135 as id_subject from dual
    -- ...end of test data
    select s.id_student, x.id_subject, x.date_exam, h.hour_exam, h.hall, s.rn, h.rn_min, h.rn_max,h.xrn_min, h.xrn_max
    from exams x
      select date_exam, hour_exam, id_subject, hx.hall, nr_places
      , nvl(
         sum(h.nr_places) over (
           partition by date_exam, hour_exam, id_subject
           order by hx.hall
           range between unbounded preceding and 1 preceding
         ,0
         ) + 1 as rn_min
      , nvl(
         sum(h.nr_places) over (
           partition by date_exam, hour_exam, id_subject
           order by hx.hall
           range between unbounded preceding and current row
        ,0
        )     as rn_max
      , nvl(
         sum(h.nr_places) over (
           partition by date_exam, hour_exam, id_subject
           order by hx.hall
           range between unbounded preceding and unbounded following
         ,0
         +   nvl(
         sum(h.nr_extra_places) over (
           partition by date_exam, hour_exam, id_subject
           order by hx.hall
           range between unbounded preceding and 1 preceding
         ,0
         + 1 as xrn_min
      , nvl(
         sum(h.nr_places) over (
           partition by date_exam, hour_exam, id_subject
           order by hx.hall
           range between unbounded preceding and unbounded following
         ,0
         +   nvl(
         sum(h.nr_extra_places) over (
           partition by date_exam, hour_exam, id_subject
           order by hx.hall
           range between unbounded preceding and current row
         ,0
         as xrn_max
      from halls_exams hx
         , halls       h
      where h.hall = hx.hall
      ) h
    , (select id_student,sname, yr, major, row_number() over(partition by yr,major order by id_student) as rn from students) s
    where h.id_subject=x.id_subject
    and   h.date_exam = x.date_exam
    and   h.hour_exam = x.hour_exam
    and   s.yr=x.yr
    and   s.major=x.major
    and   (s.rn between h.rn_min and h.rn_max
        or s.rn between h.xrn_min and h.xrn_max
    order by s.id_student
    ID_STUDENT ID_SUBJECT DATE_EXAM   HOUR_EXAM  HALL  RN  RN_MIN  RN_MAX  XRN_MIN  XRN_MAX 
    pm095631   115        2010/10/15  12         1     1   1       10      21       22      
    pm095632   115        2010/10/15  12         1     2   1       10      21       22      
    pm095633   115        2010/10/15  12         1     3   1       10      21       22      
    pm095634   115        2010/10/15  12         1     4   1       10      21       22      
    pm095635   115        2010/10/15  12         1     5   1       10      21       22      
    pm095636   115        2010/10/15  12         1     6   1       10      21       22      
    pm095637   115        2010/10/15  12         1     7   1       10      21       22      
    pm095638   115        2010/10/15  12         1     8   1       10      21       22      
    pm095639   115        2010/10/15  12         1     9   1       10      21       22      
    pm095640   115        2010/10/15  12         1     10  1       10      21       22      
    pm095641   115        2010/10/15  12         3     11  11      20      23       24      
    pm095642   115        2010/10/15  12         3     12  11      20      23       24      
    pm095643   115        2010/10/15  12         3     13  11      20      23       24      
    pm095644   115        2010/10/15  12         3     14  11      20      23       24      
    pm095645   115        2010/10/15  12         3     15  11      20      23       24      
    pm095646   115        2010/10/15  12         3     16  11      20      23       24      
    pm095647   115        2010/10/15  12         3     17  11      20      23       24      
    pm095648   115        2010/10/15  12         3     18  11      20      23       24      
    pm095649   115        2010/10/15  12         3     19  11      20      23       24      
    pm095650   115        2010/10/15  12         3     20  11      20      23       24      
    pm095651   115        2010/10/15  12         1     21  1       10      21       22      
    pm095652   115        2010/10/15  12         1     22  1       10      21       22      
    pm095653   115        2010/10/15  12         3     23  11      20      23       24      
    pm095654   115        2010/10/15  12         3     24  11      20      23       24      
    24 rows selected

  • Populate table with Rowset

    Hi all,
    I am currently working on a page that reads an Excel file, eventually I would like it to read other types of files as well, that contains information for the purpose of storing in a database. What I am trying to do is read in the contents of the Excel file and generate a rowset with that information for multiple records and then display those contents on a table of some sort that is populated by that rowset. I've been messing around with cachedrowset a little but I am not sure if that's a step in the right direction. Has anyone else tried this or does anyone know of a better way to accomplish what I am trying?
    Thank you.
    Brian

    Frank,
    Thanks for the reply. What I'm wanting to do is read in a file that contains records that will go into the database, right now I'm focusing on Excel files that can contain one to many (as many as 1000) rows. I've already learned a method to extract the data from each cell and assign it to a variable or textfield, so what I was trying to do is generate a rowset with each row of the Excel file, but not commit it to the database immediately. I would like the rows in the rowset to also fill out some kind of visual component on the page, such as a table, for the user to see the records that they just uploaded and are about to commit to the database. The user can then modify or commit these records to the database.
    As far as my technology preference, I don't really have one, but when I was given the task, rowsets were mentioned so I've been trying to use those.
    Thanks,
    Brian

  • How to Bind a Combo Box so that it retrieves and display content corresponding to the Id in a link table and populates itself with the data in the main table?

    I am developing a desktop application in Wpf using MVVM and Entity Frameworks. I have the following tables:
    1. Party (PartyId, Name)
    2. Case (CaseId, CaseNo)
    3. Petitioner (CaseId, PartyId) ............. Link Table
    I am completely new to .Net and to begin with I download Microsoft's sample application and
    following the pattern I have been successful in creating several tabs. The problem started only when I wanted to implement many-to-many relationship. The sample application has not covered the scenario where there can be a any-to-many relationship. However
    with the help of MSDN forum I came to know about a link table and managed to solve entity framework issues pertaining to many-to-many relationship. Here is the screenshot of my application to show you what I have achieved so far.
    And now the problem I want the forum to address is how to bind a combo box so that it retrieves Party.Name for the corresponding PartyId in the Link Table and also I want to populate it with Party.Name so that
    users can choose one from the dropdown list to add or edit the petitioner.

    Hello Barry,
    Thanks a lot for responding to my query. As I am completely new to .Net and following the pattern of Microsoft's Employee Tracker sample it seems difficult to clearly understand the concept and implement it in a scenario which is different than what is in
    the sample available at the link you supplied.
    To get the idea of the thing here is my code behind of a view vBoxPetitioner:
    <UserControl x:Class="CCIS.View.Case.vBoxPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:v="clr-namespace:CCIS.View.Case"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    d:DesignWidth="300"
    d:DesignHeight="200">
    <UserControl.Resources>
    <DataTemplate DataType="{x:Type vm:vmPetitioner}">
    <v:vPetitioner Margin="0,2,0,0" />
    </DataTemplate>
    </UserControl.Resources>
    <Grid>
    <HeaderedContentControl>
    <HeaderedContentControl.Header>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
    <TextBlock Margin="2">
    <Hyperlink Command="{Binding Path=AddPetitionerCommand}">Add Petitioner</Hyperlink>
    | <Hyperlink Command="{Binding Path=DeletePetitionerCommand}">Delete</Hyperlink>
    </TextBlock>
    </StackPanel>
    </HeaderedContentControl.Header>
    <ListBox BorderThickness="0" SelectedItem="{Binding Path=CurrentPetitioner, Mode=TwoWay}" ItemsSource="{Binding Path=tblParties}" />
    </HeaderedContentControl>
    </Grid>
    </UserControl>
    This part is working fine as it loads another view that is vPetioner perfectly in the manner I want it to be.
    Here is the code of vmPetitioner, a ViewModel:
    Imports Microsoft.VisualBasic
    Imports System.Collections.ObjectModel
    Imports System
    Imports CCIS.Model.Party
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' ViewModel of an individual Email
    ''' </summary>
    Public Class vmPetitioner
    Inherits vmParty
    ''' <summary>
    ''' The Email object backing this ViewModel
    ''' </summary>
    Private petitioner As tblParty
    ''' <summary>
    ''' Initializes a new instance of the EmailViewModel class.
    ''' </summary>
    ''' <param name="detail">The underlying Email this ViewModel is to be based on</param>
    Public Sub New(ByVal detail As tblParty)
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Me.petitioner = detail
    End Sub
    ''' <summary>
    ''' Gets the underlying Email this ViewModel is based on
    ''' </summary>
    Public Overrides ReadOnly Property Model() As tblParty
    Get
    Return Me.petitioner
    End Get
    End Property
    ''' <summary>
    ''' Gets or sets the actual email address
    ''' </summary>
    Public Property fldPartyId() As String
    Get
    Return Me.petitioner.fldPartyId
    End Get
    Set(ByVal value As String)
    Me.petitioner.fldPartyId = value
    Me.OnPropertyChanged("fldPartyId")
    End Set
    End Property
    End Class
    End Namespace
    And below is the ViewMode vmParty which vmPetitioner Inherits:
    Imports Microsoft.VisualBasic
    Imports System
    Imports System.Collections.Generic
    Imports CCIS.Model.Case
    Imports CCIS.Model.Party
    Imports CCIS.ViewModel.Helpers
    Namespace CCIS.ViewModel.Case
    ''' <summary>
    ''' Common functionality for ViewModels of an individual ContactDetail
    ''' </summary>
    Public MustInherit Class vmParty
    Inherits ViewModelBase
    ''' <summary>
    ''' Gets the underlying ContactDetail this ViewModel is based on
    ''' </summary>
    Public MustOverride ReadOnly Property Model() As tblParty
    '''' <summary>
    '''' Gets the underlying ContactDetail this ViewModel is based on
    '''' </summary>
    'Public MustOverride ReadOnly Property Model() As tblAdvocate
    ''' <summary>
    ''' Gets or sets the name of this department
    ''' </summary>
    Public Property fldName() As String
    Get
    Return Me.Model.fldName
    End Get
    Set(ByVal value As String)
    Me.Model.fldName = value
    Me.OnPropertyChanged("fldName")
    End Set
    End Property
    ''' <summary>
    ''' Constructs a view model to represent the supplied ContactDetail
    ''' </summary>
    ''' <param name="detail">The detail to build a ViewModel for</param>
    ''' <returns>The constructed ViewModel, null if one can't be built</returns>
    Public Shared Function BuildViewModel(ByVal detail As tblParty) As vmParty
    If detail Is Nothing Then
    Throw New ArgumentNullException("detail")
    End If
    Dim e As tblParty = TryCast(detail, tblParty)
    If e IsNot Nothing Then
    Return New vmPetitioner(e)
    End If
    Return Nothing
    End Function
    End Class
    End Namespace
    And final the code behind of the view vPetitioner:
    <UserControl x:Class="CCIS.View.Case.vPetitioner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:vm="clr-namespace:CCIS.ViewModel.Case"
    mc:Ignorable="d"
    Width="300">
    <UserControl.Resources>
    <ResourceDictionary Source=".\CompactFormStyles.xaml" />
    </UserControl.Resources>
    <Grid>
    <Border Style="{StaticResource DetailBorder}">
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <TextBlock Grid.Column="0" Text="Petitioner:" />
    <ComboBox Grid.Column="1" Width="240" SelectedValuePath="." SelectedItem="{Binding Path=tblParty}" ItemsSource="{Binding Path=PetitionerLookup}" DisplayMemberPath="fldName" />
    </Grid>
    </Border>
    </Grid>
    </UserControl>
    The problem, presumably, seems to be is that the binding path "PetitionerLookup" of the ItemSource of the Combo box in the view vPetitioner exists in a different ViewModel vmCase which serves as an ObservableCollection for MainViewModel. Therefore,
    what I need to Know is how to route the binding path if it exists in a different ViewModel?
    Sir, I look forward to your early reply bringing a workable solution to the problem I face. 
    Warm Regards,
    Arun

  • Excel Table with Data Connection Manual Text Entry Misaligned After Refresh

    Greetings!
    I have an Excel 2010 workbook that includes a table linked to my SharePoint 2013 site by a data connection. The SharePoint list feeds the table standard information that's managed on the SharePoint site, but I need the user of the Excel workbook to be able
    to enter text manually in the workbook to associate local information with the line-items coming from the SharePoint list. To do this, I've added extra columns to the end of the table.
    The user can enter information in the appropriate cells in the "extra" columns at the end of the table, but when I refresh the data connection, the addition of a new list item on the SharePoint side results in the user's manually entered text getting
    out of alignment with the row it's supposed to be associated with.
    Example
    Column 1(SP)
    Column 2(Extra)
    Row 1
    Item 1
    Row 2
    Item 2
    Text entered for Item 2
    Row 3
    Item 3
    Then, if I add a new item to the list in SharePoint, for example, something that would appear between the original items 1 & 2, after refreshing the table, I get the following:
    Column 1(SP)
    Column 2(Extra)
    Row 1
    Item 1
    Row 2
    New Item 1.5
    Text entered for Item 2
    Row 3
    Item 2
    Row 4
    Item 3
    The table's data connection is set to insert rows for new items, and I could swear I had this working properly once upon a time...but I can't seem to make it work now.
    Any thoughts on what would cause this?
    Thanks in advance!

    Yes, it is. I realized after posting the first time, that I'd assigned the question to the Visio forum. I wasn't sure how to reassign to the correct (Excel) forum, so I re-posted over there:
    http://social.msdn.microsoft.com/Forums/en-US/b3bbe00c-94c0-48d4-bed9-fbd08d707b1d/excel-table-with-sharepoint-data-connection-manual-text-entry-misaligned-after-refresh?forum=exceldev

  • Problem with checkbox group in row popin of table.

    In table row popin I have kept Check Box Group.I have mapped  the texts property of checkbox group to the attribute which is under the subnode of the table.the subnode properties singleton=false,selectioncardinality=0-n,and cardinality=0-n.
    if there are 'n' number of records in the table.each record will have its own row popin and in the row popin there is check box group.
    the check box group in the row popin  belongs to that perticular row.
    but the checkboxegroup values in row popins of all the  rows are getting changed to the row which is lead selected.
    The same scenario  (table in the row popin is showing the values corresponding to its perticular row and all the table values in popin are not getting changed to the one lead selected in the main table)is working fine with the table in place of  checkbox group in row popin with datasource property of table  binded to the subnode
    I cant trace out the problem with checkbox group in place of table.
    Please help me in this regard.I have to place check box group in place of table in row popin.
    Thanks and Regards
        Kiran Kumar K

    I have done the same thing successfully with normal check box ui element. Try using check box in your tabel cell editor instead of check box group.

  • How to populate table rows with selected listbox items?

    Hello,
    I am trying to populate a table with selected listbox items. Each item should be a new row in the table. The picture below is the listbox and table I am using. I need to get the selected name to populate the Attendee column of the table when the user clicks the Add button. How do you do this with mutltiple attendees selected?
    Thank you,
    Angie

    So you're considering the fact the if the user clicks the button twice, the name will appear twice and you don't want this, right?
    Then you must check if any value is the same than the one you are about to add in the row..
    for (var i = 0 ; i < ListBox1.length; i++){
         if (ListBox1.getItemState(i) == true){
              for (var x = 0 ; x < Table1._Row1.count; x++){
                   var boNewAttendee = true;
                   var strAttendee = Table1.resolveNode("Row1[" + x.toString() + "]").txtAttendee;
                   var newAttendee = ListBox1.getDisplayItem(i);
                   if (strAttendee.rawValue == newAttendee){
                        boNewAttendee = false;
                        break;
              if (boNewAttendee){
                   txtAttendee.rawValue = ListBox1.getDisplayItem(i);

  • How to populate a jsf table with an array?

    I have a JSF project where I'm using a table and I would like to populate that table with some custom information without using a database. I'm trying to write my own data provider. I was wondering if anyone knows how to populate a jsf table using an array. Any help would be appreciated. Thanks.

    Hey thanks for replying. I'm not quite sure what you mean, but I am using a woodstock table in Netbeans. I would love to skip writing the data provider since I've never done that before, but I'm not sure how I would go about populating the table with a regular List or Model. I have populated a JTable with my own model, but never a woodstock table. They don't seem to work the same way. Thanks for the help. I've spent hours trying to figure this out.

  • How to populate a table with ORDSYS.ORDImage item by BLOB item?

    Hi, I have a table, that contain blob column and another table with ORDSYS.ORDImage column and I would like to populate ORDSYS.ORDImage item in table by BLOB item, in which I have store some images?

    You should be able to do something like (this is off the top of my head, so please excuse any compile errors...):
    define
    b blob;
    i ordsys.ordimage;
    begin
    INSERT INTO ordsysImgs VALUES (1,ORDSYS.ORDImage.init());
    select imgCol into i from ordsysImgs where ID = 1 for update;
    select blobcol into b from blobImgTable;
    i.source.localdata := b;
    i.setlocal();
    i.setproperties();
    update imgcol set imgCol = i where ID = 1;
    commit;
    end;

  • MATERIALIZED view on two tables with Fast Refresh

    i Wanted to create MV on two tables with Fast refresh on commit.
    I followed below steps
    create materialized view log on t1 WITH PRIMARY KEY, rowid;
    create materialized view log on t2 WITH PRIMARY KEY, rowid;
    CREATE MATERIALIZED VIEW ETL_ENTITY_DIVISION_ASSO_MV
    REFRESH fast ON commit
    ENABLE QUERY REWRITE
    AS
    select A.ROWID B.ROWID,a.c1, DECODE(a.c1,'aaa','xxx','aaa') c2
    from t1 A
    join t2 b
    on AB.c1= CD.c2;
    i am getting below error.
    Error report:
    SQL Error: ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
    12054. 00000 - "cannot set the ON COMMIT refresh attribute for the materialized view"
    *Cause:    The materialized view did not satisfy conditions for refresh at
    commit time.
    *Action:   Specify only valid options.
    Basically i want to take record in MV by joinig two tables and if both of the base tables will updated then record should reflect in materialised view.
    Please do the needfull.

    does the table support PCT? the other restrictions on joins look to be ok in your statement.
    maybe try creating first with on demand instead of commit to see does it create.
    http://docs.oracle.com/cd/B19306_01/server.102/b14223/basicmv.htm
    >
    Materialized Views Containing Only Joins
    Some materialized views contain only joins and no aggregates, such as in Example 8-4, where a materialized view is created that joins the sales table to the times and customers tables. The advantage of creating this type of materialized view is that expensive joins will be precalculated.
    Fast refresh for a materialized view containing only joins is possible after any type of DML to the base tables (direct-path or conventional INSERT, UPDATE, or DELETE).
    A materialized view containing only joins can be defined to be refreshed ON COMMIT or ON DEMAND. If it is ON COMMIT, the refresh is performed at commit time of the transaction that does DML on the materialized view's detail table.
    If you specify REFRESH FAST, Oracle performs further verification of the query definition to ensure that fast refresh can be performed if any of the detail tables change. These additional checks are:
    A materialized view log must be present for each detail table unless the table supports PCT. Also, when a materialized view log is required, the ROWID column must be present in each materialized view log.
    The rowids of all the detail tables must appear in the SELECT list of the materialized view query definition.
    If some of these restrictions are not met, you can create the materialized view as REFRESH FORCE to take advantage of fast refresh when it is possible. If one of the tables did not meet all of the criteria, but the other tables did, the materialized view would still be fast refreshable with respect to the other tables for which all the criteria are met.

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

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

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

Maybe you are looking for

  • Planned vs Actual Cost Report (with variance) for PM Orders

    Hi Experts, We are using the project system to collate order costs for annual shut work.  We have a requirement for a report to show 25% variance between planned and actual order costs (maintneance order). At this stage, we dont mind whether this is

  • Upgrade to 4.0 - asking for 'follow-up activities for middleware'?!??!!

    HI, My upgrade from 3.1 to 4.0 has been going smoothly up to now. It stopped in phase REQ_BBWPCRM now asking me to perform the actions in the chapter 'Follow-up activities for the Middleware' in the documentation 'Upgrade Guide - CRM 5.0'. No mention

  • Guest-wired access connections drop every 1- 2 minutes

    I have an interesting problem. My connections to the guest wired access drop consistanly every 1 -2 minutes. There are no drops in the mobility between the WiSM and the 4402 anchor in the DMZ.  DHCp is served from the 4402 DMZ controller as well as t

  • UNICODE Byte Order Marker at beginning of text files

    Hi, I'm running in to problems when reading text from a number of text files, some of which are plain US-ASCII text and others which are also plain US-ASCII content but contain a UNICODE UTF-8 Byte Order Mark at the beginning of the file i.e. the byt

  • "error while evaluating Java script for the package"

    Okay, this is a new one on me! Anyone ever get this message? I don't know what is going on with my iMac, all I know is that about a month ago my iTunes was working fine, and when I just went to use it, it tells me "you can not use the application iTu