Re: Functions

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Sat, 21 Feb 2009 17:43:06 +0100
Message-ID: <49a02f1c$0$190$e4fe514c_at_news.xs4all.nl>



Mtek schreef:
> This is interesting. Say I have a package with a function in it. The
> function is local to that package only and is not called from the
> outside.
>
> Now, I have a line like this:
>
> v_select := 'SELECT col1, col2, GET_PRICE(col3) FROM products';
> open p_output for v_select;
>
> That fails. But, if I create the function by itself, as a normal
> function, then it works fine. Why is this?
>
>
>

I (have to) guess that you call the statement v_select := ... from within your package, right?
Dynamic SQL is not executed within the context of your package, so for this statement, GET_PRICE is invisible.
If you did something like this in your package: SELECT GET_PRICE(col3) ... into ... in your package, it would be within the scope of your package. Furthermore, get_price must be declared BEFORE the call, or otherwise have a forward declaration.

Shakespeare Received on Sat Feb 21 2009 - 10:43:06 CST

Original text of this message