Self join to get related records in one row

I have a table that has individual records for each family member.
tPerson.LastName, tPerson.FirstName, tPerson.RelationshipCode, tPerson.FamilyUnitCode, tPerson.JobCode
Smith, John,HD, 1234, AD
Smith, Jill, SP, 1234, TC
Olson, Fred, HD, 2345, AV
Olson, Wilma, SP, 2345, MD
Adams, Nate, HD, 3456, DP
Adams, Heidi, SP, 3456, DP
Franks, John, HD, 4567, AV
Williams, Pauline, HD, 5678, TC
I need to get each family unit in one row, preferably without a group on, for a report because I need to compare the jobcodes of HD and SP to decide how to build an expression for a listing. I need to also get singles with no spouse info.
FamilyCode, Lastname, HDFirstName, SPFirstName, HDJobCode, SPJobCode
1234, Smith, John, Jill, AD, TC
2345, Olson, Fred, Wilma, AV, MD
3456, Adams, Nate, Heidi, DP, DP
4567, Franks, John, NULL, AV, NULL
5678, Williams, Pauline, NULL, TC, NULL
Does the type on constraint affect the effect of an inner join? I have trouble getting the left side returning rows where there is no SP records for that familyCode.
Any help? John

>> I have a table that has individual records [sic] for each family member. <<
Rows are not records. And you posted no DDL.
Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying
temporal data. We need to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for:
https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
The sample data looks like it has a tibble on it. This is the classic design error of putting meta data, like a “t-” on tables and data element names. The next classic error you made
is a table name that is singular and vague; do you really have only one “Person” in a table? According to ISO-11179 rules, that is what you said.
>> I need to get each family unit in one row, ..<<
Not in RDBMS. Please look up the term “1NF” or “First Normal Form” which forbids structure data in columns.
But it just gets worse. Being in a family is a relationship, so it has its own table. The individuals are entities, so they have a table. Having a job is another relationship, so it is
in a third table. In your world, all these things are crammed into a single table! This might be how an OO programmer would attempt to do RDBMS that first time, but it is not good. Here is skeleton to get your started: 
CREATE TABLE Personnel
(emp_id CHAR(9) NOT NULL PRIMARY KEY,
last_name VARCHAR(20) NOT NULL,
first_name VARCHAR(20) NOT NULL);
CREATE TABLE Family_Units
(family_unit CHAR(4) NOT NULL,
relationship_code CHAR(5) NOT NULL
CHECK (relationship_code IN ('spouse', ????)),
PRIMARY KEY (family_unit, relationship_code),
emp_id_1 CHAR(9) NOT NULL
REFERENCES Personnel
ON DELETE CASCADE,
emp_id_2 CHAR(9) NOT NULL
REFERENCES Personnel
ON DELETE CASCADE,
CHECK (emp_id_1 <> emp_id_2)
CREATE TABLE Employment
(emp_id_1 CHAR(9) NOT NULL
REFERENCES Personnel
ON DELETE CASCADE PRIMARY KEY,
job_code CHAR(2) NOT NULL); -- do you know about DOT codes?
See how we use DRI actions? Etc. 
>> I need to compare the job_codes of HD and SP to decide how to build an expression [sic] for a listing. I need to also get singles with no spouse info. <<
Expression return scalar values in SQL. You meant query. Where is the SQL you attempted? Is “spouse” the only relationship? 
You have not posted enough information for anyone to really help you. What little we can extract from this says that you have no idea how about RDBMS. Want to do some reading, follow
Netiquette and try again? 
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL

Similar Messages

  • How to get multiple records in one row and different column

    Hi All,
    I am using oracle database 11g
    and i have a two tables table_1, table_2
    table_1 having columns
    emp_no
    first_name
    middle_name
    last_name
    email
    and table_2 having columns
    emp_no
    phone_type
    phone_number
    and having entires
    emp_no phone_type phone_number
    1001 MOB 9451421452
    1001 WEMG 235153654
    1001 EMG 652341536
    1002 MOB 9987526312
    1003 WEMG 5332621456
    1004 EMG 59612356
    Now i want the output of values with phone type as MOB or WEMG in a single row with different columns
    emp_no first_name middle_name last_name email mobile officeno
    1001 mark null k [email protected] 9451421452 235153654
    1002 john cena gary [email protected] 9987526312 null
    1003 dany null craig [email protected] null 5332621456
    1004 donald finn sian [email protected] null null
    can i have any inputs to achive this???
    Regards
    $sid

    Frank Kulash wrote:
    sonething like this:Frank, you missed aggregate function (pivot requires one). However main thing is it will cause ORA-01748:
    with table_1 as (
                     select 1001 emp_no,'mark' first_name,null middle_name,'k'last_name,'[email protected]' email from dual union all
                     select 1002,'john','cena','gary','[email protected]' from dual union all
                     select 1003,'dany',null,'craig','[email protected] null' from dual union all
                     select 1004,'donald','finn','sian','[email protected]' from dual
         table_2 as (
                     select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
                     select 1001,'WEMG',235153654 from dual union all
                     select 1001,'EMG',652341536 from dual union all
                     select 1002,'MOB',9987526312 from dual union all
                     select 1003,'WEMG',5332621456 from dual union all
                     select 1004,'EMG',59612356 from dual
    SELECT     *
    FROM     table_1      t1
    JOIN     table_2      t2  ON  t1.emp_no = t2.emp_no
    PIVOT     (    max(t2.phone_number)
         FOR  t2.phone_type  IN  ( 'MOB'   AS mob
                                 , 'WEMG'  AS wemg
            FOR  t2.phone_type  IN  ( 'MOB'   AS mob
    ERROR at line 19:
    ORA-01748: only simple column names allowed hereYou need to:
    with table_1 as (
                     select 1001 emp_no,'mark' first_name,null middle_name,'k' last_name,'[email protected]' email from dual union all
                     select 1002,'john','cena','gary','[email protected]' from dual union all
                     select 1003,'dany',null,'craig','[email protected] null' from dual union all
                     select 1004,'donald','finn','sian','[email protected]' from dual
         table_2 as (
                     select 1001 emp_no,'MOB' phone_type,9451421452 phone_number from dual union all
                     select 1001,'WEMG',235153654 from dual union all
                     select 1001,'EMG',652341536 from dual union all
                     select 1002,'MOB',9987526312 from dual union all
                     select 1003,'WEMG',5332621456 from dual union all
                     select 1004,'EMG',59612356 from dual
         table_3 as (
                     select  t1.emp_no,first_name,middle_name,last_name,email,
                             phone_type,phone_number
                       FROM     table_1      t1
                       LEFT JOIN     table_2      t2  ON  t1.emp_no = t2.emp_no
    SELECT     *
    FROM     table_3
    PIVOT     (    max(phone_number)
         FOR  phone_type  IN  ( 'MOB'   AS mob
                                 , 'WEMG'  AS wemg
        EMP_NO FIRST_ MIDD LAST_ EMAIL                     MOB       WEMG
          1004 donald finn sian  [email protected]
          1003 dany        craig [email protected] null            5332621456
          1001 mark        k     [email protected]      9451421452  235153654
          1002 john   cena gary  [email protected]    9987526312
    SQL>SY.

  • Line separator to get multiple records in one variable

    Hi Experts,
    I have a requirement where i need to get data in the below form , in exactly one variable.
    Invoice No.       Inv. Date      Voucher   Gross Amount    TDS Amount     Discount    Paid Amount  
    986013092,17   04/08/2010    00091217   32415.00            .00                 .00          32415.00
    Bharti Infot      27/07/2010     00091230   19600.00            .00                 .00          19600.00
    9860442689    04/08/2010       001247     47374.00            .00                  .00         47374.00
    2031565000,2031565000Total Amount     99389.00             .00                  .00         99389.00
    As of now, I have written the following,
    loop at lt_merge into ls_merge.
      lv_skfbt  = ls_MERGE-SKFBT.
      lv_budat  = Ls_MERGE-budat.
      lv_wskto  = Ls_MERGE-wskto.
      lv_wrbtr  = Ls_MERGE-wrbtr.
      lv_WT_QBSHB = ls_merge-WT_QBSHB.
    concatenate invoice_id
                ls_merge-BELNR
                lv_BUDAT
                ls_merge-XBLNR
                lv_skfbt
                lv_wt_qbshb
                lv_WSKTO
                lv_wrbtr
    into invoice_id separated by space.
    endloop.
    which gives me one row of the table where, invoice_id stores my entire one record as a string. My question is how do I proceed with separating the lines if I have multiple records?
    Thanks in advance..
    Regards,
    Trishna

    HI
    choose some character that will be not use in your data for example '|' vertical separator. You will get string:
    invoice_id  = line1 | line2 | line3 |.....
    loop at lt_merge into ls_merge.
    lv_skfbt = ls_MERGE-SKFBT.
    lv_budat = Ls_MERGE-budat.
    lv_wskto = Ls_MERGE-wskto.
    lv_wrbtr = Ls_MERGE-wrbtr.
    lv_WT_QBSHB = ls_merge-WT_QBSHB.
    concatenate invoice_id
    ls_merge-BELNR
    lv_BUDAT
    ls_merge-XBLNR
    lv_skfbt
    lv_wt_qbshb
    lv_WSKTO
    lv_wrbtr
    into invoice_id separated by space.
    new code
    concatenate  invoice_id '|' into invoice_id
    endloop.

  • Displaying records in one row??

    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34I had written a query(splitting KBIM code data & PBIM code data which actually brought back results as seen below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     NULL     NULL
    NULL     NULL     Y     B1234I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234

    Hi,
    francislazaro wrote:
    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34...
    I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234
    So you don't want anything in the results about userrecordids 'm002' and 'm003', because they do not have both board_codes 'KBIM' and 'PBIM', is that it?
    One way to get those results is a self-join, as if all the rows with borad_code 'KBIM' were in one table, and all the rows with borad_code 'PBIM' were in another:
    SELECT     'Y'          AS "KBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    ,     'Y'          AS "PBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    FROM     boards     k
    JOIN     boards     p     ON     k.userrecordid     = p.usrrecordid
    WHERE     k.board_codes     = 'KBIM'
    AND     p.board_codes     = 'PBIM'
    ;Another way is a GROUP BY, like Mpautom suggested.
    If your requirements change in the future, so that you need to include all rows, even if they don't have both board_codes, then you could change the JOIN to a FULL OUTER JOIN and make what I wrote as the WHERE clause part of the join condition, but I suspect the GROUP BY approach would be more efficient in that case.

  • Multiple record in one row..

    Hi experts,
    I want to merge multiple row from same table into one row... is it possible? if so then how??
    Regards,
    SKP

    Sure, it's possible
    create table scott.a
    as
    select 1 a, 2 b from dual     
    union all
    select 3 a, 4 b from dual     
    create table scott.b
    (a number, b number, c number, d number)
    insert into scott.b
    select a1.a,a1.b,a2.a,a2.b from scott.a a1, scott.a a2
    where a1.a = 1 and a2.a = 3
    P.S. Sorry, at first misunderstood the task
    Message was edited by:
    Dmytro Dekhtyaryuk

  • Multiple records in one row

    Hi all,
    I want to display all the party codes which have same party name,
    and I want to display all the party codes in one row separated by comma. is it possible?

    You can either use analytic functions + hierarchy or stragg (listagg if you are on 11.2) or undocumentd wm_concat. There are plenty examples on this forum. For example:
    select  deptno,
            ltrim(sys_connect_by_path(job,','),',') job_list
      from  (
             select  deptno,
                     job,
                     row_number() over(partition by deptno order by job) rn
               from  emp
      where connect_by_isleaf = 1
      start with rn = 1
      connect by deptno = prior deptno
             and rn = prior rn + 1
        DEPTNO JOB_LIST
            10 CLERK,MANAGER,PRESIDENT
            20 ANALYST,ANALYST,CLERK,CLERK,MANAGER
            30 CLERK,MANAGER,SALESMAN,SALESMAN,SALESMAN,SALESMAN
    select  deptno,
            rtrim(stragg(job || ','),',') job_list
      from  emp
      group by deptno
        DEPTNO JOB_LIST
            10 MANAGER,PRESIDENT,CLERK
            20 CLERK,ANALYST,CLERK,ANALYST,MANAGER
            30 SALESMAN,MANAGER,SALESMAN,SALESMAN,CLERK,SALESMAN
    select  deptno,
            wm_concat(job) job_list
      from  emp
      group by deptno
        DEPTNO JOB_LIST
            10 MANAGER,PRESIDENT,CLERK
            20 CLERK,ANALYST,CLERK,ANALYST,MANAGER
            30 SALESMAN,MANAGER,SALESMAN,SALESMAN,CLERK,SALESMANSY.

  • How to get missing records from one table

    I have one table with many records in the table. Each time a record is entered the date the record was entered is also saved in the table.
    I need a query that will find all the missing records in the table.
    so if I have in my table:
    ID          Date          Location
    1           4/1/2015        bld1
    2           4/2/2015        bld1
    3           4/4/2015        bld1
    I want to run a query like
    Select Date, Location FROM [table] WHERE (Date Between '4/1/2015' and '4/4/2015') and (Location = bld1)
    WHERE Date not in
    (Select Date, Location FROM [table])
    and the results would be:
    4/3/2015   bld1
    Thank you

    Do you have a table with all possible dates in it?  You can do a left join from that to your above mentioned table where the right side of the join is null.  If you don't have a table with all possible dates you could user a numbers table.
    Below is one way to achieve what you want with a numbers table...
    DECLARE @Table table (ID Int, DateField Date, Location VarChar(4))
    DECLARE @RunDate datetime
    SET @RunDate=GETDATE()
    IF OBJECT_ID('dbo.Numbers') IS NOT NULL 
    DROP TABLE NUMBERS
    SELECT TOP 10000 IDENTITY(int,1,1) AS Number
       into Numbers
        FROM sys.objects s1
        CROSS JOIN sys.objects s2
    ALTER TABLE Numbers ADD CONSTRAINT PK_Numbers PRIMARY KEY CLUSTERED (Number)
    INSERT INTO @Table (ID, DateField, Location)
    VALUES ('1','20150401','bld1')
    ,('1','20150402','bld1')
    ,('1','20150404','bld1');
    WITH AllDates
    as
    SELECT DATEADD(dd,N.Number,D.StartDate) as Dates
    FROM Numbers N
    cross apply (SELECT CAST('20150101' as Date) as StartDate) as D
    select * 
    from AllDates AD
    left join @Table T on AD.Dates = T.DateField
    where ad.Dates between '20150401' and '20150404'
    AND T.ID IS NULL
    LucasF

  • How to get last Record ior Total rows in For Loop Cursor ?

    Hi Friends
    I would like to know , the last record in for loop cursor, i have the code in following format
    cursor c1 is
    select * from emp;
    begin
    for r1 in c1 loop
    v_total_rec := ? ( i would like to know total rows in the cursor , say for example if cursor has 10 rows, i want10 into this variable )
    v_count := v_count +1;
    dbms_output.put_line(r1.emp_name);
    end loop;
    end;
    Hope i am clear
    Any suggestions?
    Thanks
    Ravi

    Even though cursor loops are generally a Bad Idea ^tm^ as Dan says, here's an example of how you can get the information you wanted within the query itself...
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    cursor c1 is
      3      select emp.*
      4            ,count(*) over (order by empno) as cnt
      5            ,count(*) over () as total_cnt
      6      from emp
      7      order by empno;
      8  begin
      9    for r1 in c1 loop
    10      dbms_output.put_line(r1.ename||' - row: '||r1.cnt||' of '||r1.total_cnt);
    11    end loop;
    12* end;
    SQL> /
    SMITH - row: 1 of 14
    ALLEN - row: 2 of 14
    WARD - row: 3 of 14
    JONES - row: 4 of 14
    MARTIN - row: 5 of 14
    BLAKE - row: 6 of 14
    CLARK - row: 7 of 14
    SCOTT - row: 8 of 14
    KING - row: 9 of 14
    TURNER - row: 10 of 14
    ADAMS - row: 11 of 14
    JAMES - row: 12 of 14
    FORD - row: 13 of 14
    MILLER - row: 14 of 14
    PL/SQL procedure successfully completed.
    SQL>

  • All rows in a Set get updated when only one row changes

    I have a complex object, which contains a Set of child objects. If i modify one of the child objects and put the object back in the cache, coherence will issue a sql update for each of the child objects, even though only one changed.
    I'm using hibernate, and when i do this in straight hibernate, that doesn't happen, only one sql update gets issued for the row in question.
    I found this because i have a timestamp column that automatically updates when the row gets updated, but since all the child rows are updating, this timestamp gets updated as well which breaks the biz logic.
    Am i missing something? Clearly it's inefficient to issue updates on all the child rows when just one changes. Is there some way to avoid this?
    Using coherence 3.5.3.
    Thanks.

    This turned out to be an issue with POF serialization of a Date object. It was doing it incorrectly, it would get the day correct, but the HH:MM:SS would be set to the current time. Since the object had been changed, when i persisted the parent, all of the child rows would persist as well since their "modify_date" attribute had been changed. Eg, if the date in the DB was "2010-07-14 03:10:00" when i read the object in, the value would change to "2010-07-14 HH:MM:SS" where HH:MM:SS would be set to the current hours/mins/secs.
    I changed the code to use my own serialization of a Date object (just used the long) and things worked fine after that.
    Is this a known issue with pof serialization?

  • How to achieve parent-child relationship using self join?

    my table structure is as follows
    parent child name
    -1     1     A1
    1     2     A2
    1     3     A3
    how to achieve the hierarchy model using self join. this can be easily achieved using "connect by prior". but how to achieve the same using self join?

    Hi,
    Yes, that's definitely possible. If you only need to display two levels from the hierarchy, a self-join is a good option. Make it an outer join if you need to show everyone on one level, regardless of whether they have a match on the other level or not; for example, if you want the output:
    child_name     child_id     parent_name     parent_id
    A1          1
    A2          2          A1          1
    A3          3          A1          1It's good that you posted some sample data. Now post the results you want from that data, and your query (what you think is the best attempt you've made so far). If you haven't tried anything so far, then look at some other simple self-join to get ideas.

  • I wanted to display the multiple rows in one row but column should be diff

    Hi
    Could any body help me regarding this query how to write to get the multiple rows in one row.
    eg.
    i have one table tab1(eno number,ename varchar2,uid1 varchar2,uid2 varchar2,uid3 varchar4)
    but when i am runing the query I am getting multiple record against one eno number because of uid1,uid2,uid3
    suppose value of table is
    eno ename uid1 uid2 uid3
    1 a u1
    1 a u2
    1 a u3
    when i am quering it is coming same as above but I want in one row
    eno ename uid1 uid2 uid3
    1 a u1 u2 u3
    can any onle help me how to write the query for this requirement.
    thanks
    saif

    which is hard coded in my code? Here another approach, but fail for c as there is no information for the value of a column: does 1 in u1 means col 1, etc.
    /* Formatted on 2012/05/29 16:29 (Formatter Plus v4.8.8) */
    WITH t AS
         (SELECT 1 col1, 'a' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'a' col2, 'u2' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'a' col2, 'u3' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u3' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u2' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'c' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'c' col2, 'u3' col3
            FROM DUAL)
    SELECT   xx.col1, xx.col2, MAX (DECODE (xx.rn, 1, col3)) AS uid1, MAX (DECODE (xx.rn, 2, col3)) AS uid2,
             MAX (DECODE (xx.rn, 3, col3)) AS uid3
        FROM (SELECT t.col1, t.col2, t.col3, ROW_NUMBER () OVER (PARTITION BY col1, col2 ORDER BY col3) rn
                FROM t) xx
    GROUP BY col1, col2;output:
    COL1     COL2     UID1     UID2     UID3
    1     a     u1     u2     u3
    1     b     u1     u2     u3
    1     c     u1     u3
    Edited by: ʃʃp on May 29, 2012 2:30 AM

  • How to pivot horizontally Author names, and group by Book title. One row per book with multiple authors

    I have 3 tables - Book, Author, BookAuthorReference
    A book can have multiple authors, and when I do straight query I get multiple rows per book
    SELECT <columns>
    FROM Book b, Author a, BookAuthorReference ba
    where ba.BookId = b.BookId and
    ba.AuthorId = a.AuthorId
    I want to get the results as ONE row per book, and Authors separated by commas, like:
    SQL 2008 internals book    Paul Randal, Kimberly Tripp, Jonathan K, Joe Sack...something like this
    Thank you in advance

    This can by done by straying into XML land. The syntax is anything but intuitive, but it works. And moreover, it is guaranteed to work.
    SELECT b.Title, substring(a.Authors, 1, len(a.Authors) - 1) AS Authors
    FROM   Books b
    CROSS  APPLY (SELECT a.Author + ','
                  FROM   BookAuthorReference ba
                  JOIN   Authors a ON a.AuthorID = ba.AuthorID
                  WHERE  ba.BookID = a.BookID
                  ORDER  BY ba.AuthorNo
                  FOR XML PATH('')) AS a(Authors)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Joining 2 related records using PL SQL in Apex - Problems when there are more than 2 related records?

    Hi
    I am combining 2 related records of legacy data together that make up a marriage record.  I am doing this in APEX using a before header process using the following code below which works well when there are only 2 related records which joins the bride and groom record together on screen in apex.  I have appended a field called principle which is set to 'Y' for the groom and 'N' for the bride to this legacy data
    However there are lots of records where in some instances there are 3, 4 , 5, 6 or even 1 record which causes the PL/SQL in APEX to not return the correct data.  The difference in these related columns is that the name of the bride or groom could be different but it is the same person, its just that from the old system if a person had another name or was formally known as they would create another duplicate record for the marriage with the different name, but the book and entry number is the same as this is unique for each couple who get married.
    How can I adapt the script below so that if there are more than 2 records that match the entry and book values then it will display a message or is there a better possible work around?  Cleaning the data would be not an option as there are thousands of rows of where these occurrences occur
    declare 
         cursor c_mar_principle(b_entry in number, b_book in varchar2) 
         is 
              select DISTINCT  id, forename, surname, marriagedate, entry, book,  formername, principle
              from   MARRIAGES mar 
              where  mar.entry   = b_entry
              and    mar.book = b_book
              order by principle desc, id asc; 
         rec c_mar_principle%rowtype;
    begin 
    open c_mar_principle(:p16_entry,:p16_book)  ;
    fetch c_mar_principle into rec;
    :P16_SURNAME_GROOM   := rec.surname; 
    :P16_FORNAME_GROOM   := rec.forename;
                   :P16_ENTRY := rec.entry; 
                   :P16_BOOK :=rec.book;
    :P16_FORMERNAME :=rec.formername;
    :P16_MARRIAGEDATE :=rec.marriagedate;
    :P16_GROOMID  := rec.id;
    fetch c_mar_principle into rec;
    :P16_SURNAME_BRIDE   := rec.surname; 
    :P16_FORNAME_BRIDE   := rec.forename;
                   :P16_ENTRY := rec.entry; 
                   :P16_BOOK :=rec.book;
    :P16_FORMERNAME :=rec.formername;
    :P16_MARRIAGEDATE :=rec.marriagedate;
    :P16_BRIDEID  := rec.id;
    close c_mar_principle;
    end;

    rambo81 wrote:
    True but that answer is not really helping this situation either?
    It's indisputably true, which is more than can be said for the results of querying this data.
    The data is from an old legacy flat file database that has been exported into a relational database.
    It should have been normalized at the time it was imported.
    Without having to redesign the data model what options do I have in changing the PL/SQL to cater for multiple occurances
    In my professional opinion, none. The actual problem is the data model, so that's what should be changed.

  • Inner Join - Not Able to get all records

    Hello All,
    I am trying to Inner Join between two tables of employee details. The Join will be done Employee ID, DOB and on name. We will have a constraint to check the first 5 characters of their name (substring). This works and get the exact count on SQL query.
    But when I translate this to SSIS, where I have done a substring with derived column and Merge Join, the count is wrong.
    Join with the employee number and dob - count is same for SQL query and in SSIS
    But when we join with name, its not equal.
    The Issue is with the name, when an employee has 3 or 4 characters of name like 'abc', join is getting ignored in SSIS. Any help to fix this.

    Put Data Viewers on both pipes which are sources for Merge Join and observe the data. Name from one source may be different than Name from other source.
    E.g.  (Tom  ) from first source - 5 letters and (Tom) from second source 3 letters.
    So you should probably try considering TRIM of blank spaces when length of Name is less than 5 letters.
    -Vaibhav Chaudhari

  • I am getting an Narration error that I can't record because one of the record-enabled tracks is locked in the timeline. What does this mean and how do I get out of it??

    I am getting an Narration error that I can't record because one of the record-enabled tracks is locked in the timeline. What does this mean and how do I get out of it??

    JohnL23
    Thanks for the update.
    There are several Adobe Premiere Elements Forum threads about situation such as the one that you have encountered. Typically they are the results of some heavy activity in the narration track.  Some have found success in maneuvers between the Expert and Quick workspaces in versions 11 and 12 or Timeline and Sceneline workspaces in versions earlier than 11. That is why I mentioned that type of factor in a prior post in your thread.
    If that is not working, then we are forced into the new project where the problems in the current project are not presenting.
    I will do a search for the threads that I am recalling about your type of issue. But, right now all roads seem to head to the new project. But I would ask "Can you salvage this project by creating your narration clips in Audacity or a new Premiere Elements project and import them into this project, putting the clips on one of the numbered audio tracks?"
    If the problem should reappear in the new project, please let us know including the details of what was going on immediate before the problem surfaced.
    Thanks.
    ATR

Maybe you are looking for

  • Advance postings in Travel Mgt through Spe GL

    Hi all, As per my clinent requirement, we are looking to post advance to employee in TMS through Special GL transactions. Can any one plz let me know the settings required for advance posting in TMS throuh Special GL. Appreciate your help. Reg Manu

  • Blob download error - "ResourceNotFound"

    Update: The problem here was caused because the container permissions got reset when uploading more files. Maybe a more informative error message such as "Access denied.." would have been more helpful. Hi, This morning I am unable to download files f

  • How to print jasperreport at client side printer? please help me...

    HI, I am new to using JasperReports. I am developing a web application using jsp and jasperreports and mysql. I was succeed with all with their examples and iReports tool. We have a requirement that client can print the report that is visible to him

  • Candy Crush failed to connect to app store

    I can't get Candy Crush to connect to app store so I can advance to next level.  I had a similar problem with purchasing the full version of Barn Yarn. Can someone help me troubleshoot problem?  I have the iPad 1st generation with ios 5 Thank you kin

  • Reg- CRM OOB Features

    Hi All, I have mentioned some of the requirements below. I would like to know whether they can possible in crm as an OOB or with custom development 1. Whenever my organization announces some new product / some news how can we spread this to all the u