Re: Help on Views

From: Mick <Mike_at_I.Dont.Want.Spam>
Date: Sun, 23 Jan 2000 08:19:05 +1100
Message-ID: <v6pi4.8550$3b6.39446_at_ozemail.com.au>


[Quoted] Tom Deseamus <tdeseamus_at_digital-hire.com> wrote in message news:vw8i4.8700$pk.107955_at_news3.mia...
> Anyone know how to run a user-defined function in a view?
>
>

Just create the view and then call it in an SQL statement such as -

SQL> create or replace function blah return varchar2 is   2 begin
  3 return ('a');
  4 end;
  5 /

Function created.

SQL> create view test as
  2 select blah from sys.dual
  3 /

View created.

SQL> select * from test
  2 /

BLAH



a

If the function is in a package, you have to use the pragma restrict_references directive in the package header, see the application developers guide - but it depends on database version.

Good luck,

Mike Cretan



Mike Cretan
Oracle Consultant
Australia
email: mcretan_at_ozemail.com.au
Received on Sat Jan 22 2000 - 22:19:05 CET

Original text of this message