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: cannot call member function on object type

Re: cannot call member function on object type

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Tue, 26 Mar 2002 11:26:04 -0000
Message-ID: <1017141884.16768.0.nnrp-07.9e984b29@news.demon.co.uk>

This may not fix it, but in 8.1.5 a number of problems disappeared if you used a 'correlation variable', a.k.a. 'table alias'.

viz:
> select col,col.getbar() from footab; -- ERROR

changes to
> select col,f.col.getbar() from footab f;

I agree that the alternative form that worked for you really does look right. It would be interesting to see if there was any internal operational difference between the way that Oracle actually executes your working SQL and the SQL above (that I hope will work).

--
Jonathan Lewis
http://www.jlcomp.demon.co.uk

Next Seminar - UK, April 3rd - 5th
http://www.jlcomp.demon.co.uk/seminar.html

Host to The Co-Operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

Author of:
Practical Oracle 8i: Building Efficient Databases


Peter Mutsaers wrote in message <87r8m74mpb.fsf_at_muon.mutsaers.com>...

>On 8.1.6 I cannot call a member function from SQL in the way described
>in the manual.
>
>The following example is almost copied from the manual:
>
>create or replace TYPE foo AS OBJECT (a1 NUMBER,
> MEMBER FUNCTION getbar RETURN NUMBER);
>create or replace type body foo is
> MEMBER FUNCTION getbar RETURN NUMBER is
> begin
> return 45;
> end;
>end;
>
>CREATE TABLE footab(col foo);
>
>SELECT col,foo.getbar(col) FROM footab; -- OK
>select col,col.getbar() from footab; -- ERROR
>
>
>The second select is the way it should be, but I get an error "invalid
>column name".
>
>Using the first select, I get the result. This is strange because this
>is more or less the 'static member' notation (filling in the implicit
>self parameter myself).
>
>Is this a known bug in 8.1.6, maybe fixed in later versions?
>
>--
>Peter Mutsaers | Dübendorf | UNIX - Live free or die
>plm_at_gmx.li | Switzerland | Sent via FreeBSD 4.4-stable
Received on Tue Mar 26 2002 - 05:26:04 CST

Original text of this message

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