>>Hi everybody,
>>
>>I have a problem to which I don't see an immediate solution, so I am hoping that great minds from UT can help me with it.
>>
>>I have a view
>>CREATE SQL VIEW LV_SAVED_SEARCHES AS ;
>>SELECT Saved_searches.* ;
>> FROM mmviscollect!saved_searches ;
>> WHERE Saved_searches.cusgrlink_fk = ( ?vp_cusgrlink_fk ) ;
>> OR Saved_searches.cusgrlink_fk = ( ?vp_vcam_fk ) ;
>> ORDER BY Saved_searches.isequence_number
>>
>>Now, in its current way it will always return all records, because we defined all of them for VCAM user. I want it to return "my" records if it finds that cUsgrLink_fk matches my cUsgrLink_fk. However, if I don't have records for my ID, I want it to return all records. Could you please help me a little bit?
>>
>>Thanks in advance.
>
>Nadya,
>
>Not exactly what you asked for, but you could break it up into 2 queries - run the one against ?vp_cusgrlink_fk first and, if _TALLY = 0, run the second against ?vp_vcam_fk.
>
>HTH,
I want it to be a view. Of course, there are workarounds like you're suggesting, but it would not be an interesting problem then < g >
If it's not broken, fix it until it is.
My Blog