Go for View or User Defined function
Hi Everybody!!,
Go for View or User Defined function
I am using 12-14 unions to get the desired output.
e.g ProductShipped is devided into four regions(North,south,east,west)
to get records of each regions i have to make 4 unions .
so i put 4 different function fn_getProductNorth,fn_getProductSouth,fn_getProduc tEast and
fn_getProductWest.
I could make one function and based on regions i could get the results.
the problem is that database is designed columnwise for each Region
i.e NorthRegion, SouthRegion,WestRegion and EastRegion are columns.
the same thing is applied for all other ProductOwner tables.
so I have to use joined on different columnName as specified by Regions.
Yes we can design good database tables but we can't modify it as per some business rules.
so ,
1>should i use View and put all the joins with Union Class.
2>should i continue with different function<for code maintainablity and reuse>
and then make union of all the functions
3>since we are only looking for records search,should i use view or function.
As i can get the results from both view and functions.
Because Admin can get records for all regions or some specific regions.
and these regions are different columns
i.e
NOrthRegion SouthRegion EastRegion
1 1 1
1 0 1
0 1 0
1 0 1
Any Help or pointer to use view or function?
Thanks In Advance.
Cheers :)
vinod
__________________
Cheers :)
vinod
|