Subject | Re: Dynamic name in a stored procedure |
---|---|
Author | randallsell |
Post date | 2007-11-15T08:50:47Z |
--- In firebird-support@yahoogroups.com, Svein Erling Tysvær
<svein.erling.tysvaer@...> wrote:
something obvious. And as it turns out I missed the forest through the
trees.
thanx again.
-randall
<svein.erling.tysvaer@...> wrote:
>if you have lots of conditions.
> Hi Randall.
>
> I'd say you have at least two other alternatives:
>
> 1) Write things directly in your stored procedure:
>
> DECLARE VARIABLE DOFULL SMALLINT;
> BEGIN
> DOFULL = 1;
> IF (DOFULL = 1) then
> FOR SELECT
> DESCRIPTION,
> COMPANYNAME
> FROM PASWORD_VIEW_FULL
> INTO
> :DESCRIPTION,
> :COMPANYNAME
> DO BEGIN
> SUSPEND;
> END
> ELSE
> FOR SELECT
> DESCRIPTION,
> COMPANYNAME
> FROM PASWORD_VIEW_LITE
> INTO
> :DESCRIPTION,
> :COMPANYNAME
> DO BEGIN
> SUSPEND;
> END
> END
>
> The drawback is that this is verbose, and quickly gets complicated
>given full access>
> 2) Replace your views with a single view with a where clause similar to:
>
> WHERE <FieldName> = <condition> or CURRENT_USER = <whomever is to be
>You are a blinkin' genious! thank you. I figured the answer was
something obvious. And as it turns out I missed the forest through the
trees.
thanx again.
-randall