Subject Re: [firebird-support] Functions in PL/SQL
Author PenWin
> You can write SPs that return a single value to the caller - which may be
> a client application, a trigger or another SP. You can't invoke them like
> functions but your requirement might enable you to define a reusable
> procedure call that will achieve the same end.

Unfortunatelly, that won't do the trick: I need a function which gets
applied to every row in a certain view.

> Why not describe what you want to do and see what suggestions come up.

Basically, I need to perform a rather complex calculation in a VIEW, one
which will need an UDF after all. UDF itself isn't a problem: I am using one
already. The problem is that unlike the rest of my application, the UDF
can't be updated automatically. I can update my application and my database
easily enough, but not the UDF. So there will inevitably be a certain amount
of time between the upgrade of the database (e.g. VIEW declarations) and the
upgrade of the UDF (functions used in those views). I can detect that the
UDF finally got upgraded, but that's about it.

So I was thinking of creating a placeholder function in plain PL/SQL, which
would simply return zero (or better yet, NULL). When the UDF got upgraded, I
would drop this placeholder function and declare an external function of the
same name and arguments.

Pepak