Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Basic SQL and package question
On Dec 19, 4:23 pm, Guy <guh..._at_yahoo.com> wrote:
> I have package procedure which returns 1 if a code is valid. Si I try:
> SELECT
> A,
> B,
> PACKAGE_1.PROC_1(A.CODE) AS CODE_PERMISSION
> FROM
> TABLE
> WHERE
> CODE_PERMISSION = 1
>
> This returns and error message: CODE_PERMISSION invalid identifier.
>
> So I have to resort to:
> SELECT
> A,
> B
> FROM
> TABLE
> WHERE
> PACKAGE_1.PROC_1(A.CODE) = 1
>
> But I have been told that calling a procedure in the "where" clause
> was invalidating any index on this table, which is uge. Any solution
> to this ? Thanks.
Use a function instead of a procedure ... then you can use it in the select clause
But even better ... do it all in pure sql instead of invoking plsql functions in sql. Received on Wed Dec 19 2007 - 15:44:43 CST
![]() |
![]() |