Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2016
    Posts
    2

    Question Unanswered: informix stored procedure

    I have several records that have the same number, year and sequence number. They are a part of one set. So on the screen in have two sets: one with only one row with number 20 and the other one with 6 rows with different sequence. The date in all the rows belonging to 1 set should be the same and populated all across one full set, if the date is empty then it should be empty across all sets:


    13 20 2004 1 aron
    13 97 2009 1 tom
    13 97 2009 2 2005.06.11 sally
    13 97 2009 3 2009.06.11 vero
    13 97 2009 4 trump
    13 97 2009 5 2009.06.11 sonny
    13 97 2009 6 2009.06.11 loren


    So my results should look like this:

    13 20 2004 1 aron
    13 97 2009 1 2005.06.11 tom
    13 97 2009 2 2005.06.11 sally
    13 97 2009 3 2009.06.11 vero
    13 97 2009 4 2009.06.11 trump
    13 97 2009 5 2009.06.11 sonny
    13 97 2009 6 2009.06.11 loren


    How can I write the stored procedure for this specific case?
    Or maybe there is a way to handle it in the view?


    Thank you for your help.

  2. #2
    Join Date
    May 2012
    Posts
    19
    your question is a bit confusing. Please post your table-CREATE Statements. Maybe this clarifies it

  3. #3
    Join Date
    Apr 2016
    Posts
    2

    Informix stored procedure

    Quote Originally Posted by koenigotto View Post
    your question is a bit confusing. Please post your table-CREATE Statements. Maybe this clarifies it
    Thank you so much for your reply. I need to finish it ASAP now.
    This is just a part of the view that i created, basically for each identical column i, column 2 and column 3 i need to insert the same date, even if the date field is blank we take one from previous record


    Create table ttt as
    CREATE TABLE sample:TEST_TABLE
    (col1 integer NOT NULL,
    col2 integer NOT NULL),
    col3 integer NOT NULL),
    col4 integer NOT NULL,
    col5 date)

    then combination column 1, column 2 column 3 can have different sequence (column 4) and for this combination if in any row date is populated populate the entire set with this date
    that is why I posted the examples:



    13 20 2004 1 aron
    13 97 2009 1 2005.06.11 tom
    13 97 2009 2 2005.06.11 sally
    13 97 2009 3 2009.06.11 vero
    13 97 2009 4 2009.06.11 trump
    13 97 2009 5 2009.06.11 sonny
    13 97 2009 6 2009.06.11 loren

    Please Help ASAP
    Thank you!
    I hope this clarifies the issue

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •