Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    9

    Unanswered: Defining hstore value

    Hi again...

    I'm totally confused for this thing, and please anyone help me with this.
    Here is the thing :
    Supposed i have a table data like this

    ID Source Shift Planned Dates
    1 ROLL4 1 "h1"=>"Pro1","h2"=>"Pro2","h3"=>"0" 2010-03-17
    2 ROLL4 2 "h4"=>"0","h5"=>"0","h6"=>"0" 2010-03-17
    3 ROLL5 1 "h1"=>"0","h2"=>"0","h3"=>"0" 2010-03-17
    4 ROLL5 2 "h4"=>"0","h5"=>"0","h6"=>"0" 2010-03-17

    0 (null) means the machine is idle (doesn't working on any process).
    ROLL4 and ROLL5 are machines that used to process the Pro1 (Product 1). Product 1 is processed by ROLL4 for 2 hours, that's why h1 and h2 are filled with Pro1. If the next process is on ROLL5 for 2 hours then the table data will be like this :

    ID Source Shift Planned Dates
    1 ROLL4 1 "h1"=>"Pro1","h2"=>"Pro2","h3"=>"0" 2010-03-17
    2 ROLL4 2 "h4"=>"0","h5"=>"0","h6"=>"0" 2010-03-17
    3 ROLL5 1 "h1"=>"0","h2"=>"0","h3"=>"Pro1" 2010-03-17
    4 ROLL5 2 "h4"=>"Pro1","h5"=>"0","h6"=>"0" 2010-03-17

    The process on ROLL5 will begin at hour 3 (h3) until hour 4 (h4) at shift 2, since the product is done processing by ROLL4 at hour 2.
    What is the script or function to make such result?
    Sorry for my bad english...
    And thank's for any attention and concern.

  2. #2
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    You are asking the wrong question. The correct question is "I've got such and such data and I want advice on how to properly model it in the database."

  3. #3
    Join Date
    Mar 2010
    Posts
    9
    I have modeled it in database. And i'm stuck in making function/store procedure or query to make such result.
    Sorry...i'm a newbie in programming.
    Thanks.

Posting Permissions

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