Subject | Re: [firebird-support] Limiting the rows user can see |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2006-01-19T04:59:26Z |
On 18 Jan 2006 at 17:14, ainpoissee wrote:
....
SELECT AYksLPK FROM SYS_TAP_Users
WHERE UserName=CURRENT_USER INTO :AYksLPK;
IF(AYksLPK = 3) THEN
FOR SELECT ... FROM TAB_Allyksus INTO ... DO
SUSPEND;
ELSE IF(AYksLPK > 0) THEN
FOR SELECT ... FROM TAB_Allyksus
JOIN SYS_UsrR_Allyksus ON (UserID = STU.UID) AND
(SYS_UsrR_Allyksus.Allyksus = TAY.UID) INTO ... DO
SUSPEND;
....
Should be faster than subselect with EXISTS.
--
SY, Dimitry Sibiryakov.
>but I have feeling that this is not the best way to do it... wht doI would use Stored Procedure with something like this inside:
>you think? any suggestions?
....
SELECT AYksLPK FROM SYS_TAP_Users
WHERE UserName=CURRENT_USER INTO :AYksLPK;
IF(AYksLPK = 3) THEN
FOR SELECT ... FROM TAB_Allyksus INTO ... DO
SUSPEND;
ELSE IF(AYksLPK > 0) THEN
FOR SELECT ... FROM TAB_Allyksus
JOIN SYS_UsrR_Allyksus ON (UserID = STU.UID) AND
(SYS_UsrR_Allyksus.Allyksus = TAY.UID) INTO ... DO
SUSPEND;
....
Should be faster than subselect with EXISTS.
--
SY, Dimitry Sibiryakov.