Re: Display view equations?

From: Rumpi Gravenstein <>
Date: Thu, 12 Jun 2008 23:33:51 -0400
Message-ID: <>

Here's another choice.

If you create the view with parsable tokens embedded within comments and then use regular expression to get what you want.


create view test_view as
SELECT /*|*/ 1+2 /*|*/ calc FROM DUAL;

Now the following SQL can be used to retrieve the calculation:

SELECT regexp_substr( 'SELECT /*|*/ 1+2 /*|*/ calc FROM DUAL;', '[^|]+,1,2) FROM DUAL; which returns

You could then remove the first and last two letters in the substr to get at what you want.

One comment with this type of an approach. The USER_VIEWS presents the "text" as a LONG column. Regular expressions don't function on LONG columns. So the view you create might need to be a pipelined table function that handles the conversion to a string.

Received on Thu Jun 12 2008 - 22:33:51 CDT

Original text of this message