Storing conditional logic expressions/rules in a database

前端 未结 5 650
说谎
说谎 2021-02-05 17:13

How can I store logical expressions using a RDBMS?

I tag objects and would like to be able to build truth statements based on those tags. (These might be considered as

5条回答
  •  旧时难觅i
    2021-02-05 17:37

    Managing the nesting/brackets can become quite complex and prone to errors. The way I have done this in the past is to use XML to define the logic as it handles nesting very well. Using SQL Server 2005 or higher you can also store this nicely in a single table.

    Your second hand goods logic could be stored as...

    
        
            
                
            
            
        
        
    
    

    I'm sorry this is not an actual answer to your question and just an alternative way of doing things. I've just found it to work for me in the past.

提交回复
热议问题