Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Basic SQL and package question

Re: Basic SQL and package question

From: hpuxrac <johnbhurley_at_sbcglobal.net>
Date: Wed, 19 Dec 2007 13:44:43 -0800 (PST)
Message-ID: <b1de7cca-080d-4703-9c00-bcad2eeb38a6@i12g2000prf.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US