Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2007
    Posts
    4

    Unanswered: How to store condition?

    Hi all,

    I have table [TableFunction]. [TableFunction] contain IDs of my functions and parameters of this functions. Result of each function is TRUE or FALSE.

    [TableFunction]
    FunctionID | FunctionParam1 | FunctionParam2 <--- column names
    ------------------------------------------------------
    1 | 56 | 67 <-- first row
    2 | 89 | 33 <-- second row
    3 | 29 | 13 <-- third row
    4 | 28 | 17 <-- fourth row
    ... next rows
    ------------------------------------------------------

    Now I need to store conditions betwen functions stored at [FunctionTable]. Something like this:

    [TableContidion]
    ConditionID | Condition <--- column names
    ---------------------------------------
    1 | (1 AND 3) OR 4
    2 | 4 OR 3 OR 1
    3 | 4 OR 3 OR 1 OR (1 AND 2)
    ... next rows
    --------------------------------------

    I can store conditions as strings but it is not good solution probably. Do you know best way to solve it? Each contidion must be unique.

    Thank you very much.

    Veolw

  2. #2
    Join Date
    Nov 2008
    Posts
    23
    hi Veolw,
    I was waiting to see if anyone will answer your question. If you don't take me wrong, your requirement spec is little too sketchy. That kind of a setup requires proper planning and design, if you are expecting it to be scaleable across your application.

    Are you new to this kind of thing and also are you trying to mimic some other system you have been comfortable with earlier, like Access etc?

    From whatever I could understand in your post, if your only issue is about using strings, you can use bit patterns to achive these operations. SQL Server 2005 has considerable support for bitwise operations.

    May be if you make your spec more clear, and specify how scaleable you want the solution to be, some one may be able to chip in.

    hope it helps
    jambu

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Agreed with Jambu. Telling us the end game (what your eventual goal is and how you will use this) would help
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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