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

Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL - NULL SELF error on member function

Re: PL/SQL - NULL SELF error on member function

From: <michael_bialik_at_my-deja.com>
Date: 2000/04/26
Message-ID: <8e6k9u$nl2$1@nnrp1.deja.com>#1/1

Hi.

 You have 2 errors in your script.

  1. The simple one - > insert into seq_id values (1,'mytable','mycolumn'); Can NOT work. Must use: insert into seq_id values ('mytable','mycolumn', 1);
  2. ( Probably the cause of of ORA-30625 ). Incorrect closure of COMMENT line: > /* initialize the instance of object o_sequence /* > w_objseq := o_sequence(null,null,null); > /* calls the procedure with params */ The comment starts on first line , but because of '/*' at end of line ( typo ??? ) it closes only at 3-rd line. w_objseq := o_sequence(null,null,null); -- Is NOT executed.

  HTH. Michael.

In article <8e20lb$uoc$1_at_nnrp1.deja.com>,   newdb_at_my-deja.com wrote:
> Guys,
> I am getting an "ORA-30625: method dispatch on NULL SELF argument is
> disallowed" when calling a method that is a function of an object
 type.
> The purpose of the table seq_id is providing a sequence number (there
> are some reasons why we can't use sequences).
> A script is included bellow, after the error msg.
> Thanks in advance.
>
> The error shows as listed here:
> SQL> exec p_seq
> BEGIN p_seq; END;
> *
> ERROR at line 1:
> ORA-30625: method dispatch on NULL SELF argument is disallowed
> ORA-06512: at "P_SEQ", line 14
> ORA-06512: at line 1
>
> Script:
> drop table seq_id;
> CREATE or REPLACE TYPE o_sequence AS OBJECT
> (
> table_nm varchar2(30),
> column_nm varchar2(30),
> next_id number,
> MEMBER FUNCTION get_next_id (par_table_nm IN varchar2,
> par_column_nm IN varchar2,
> par_nr IN OUT NUMBER)
> RETURN integer
> );
> /
> create table seq_id of o_sequence;
> insert into seq_id values (1,'mytable','mycolumn');
> commit;
> create or replace type body o_sequence as
> member function get_next_id (par_table_nm IN varchar2,
> par_column_nm IN varchar2,
> par_nr IN OUT NUMBER)
> return integer as
> w_qty integer;
> begin
> select next_id into w_qty from seq_id
> where table_nm = par_table_nm and column_nm =
> par_column_nm
> for update;
> if par_nr > 1 then
> w_qty := w_qty + par_nr;
> end if;
> update seq_id set next_id = w_qty + 1 ;
> return w_qty;
> end get_next_id;
> end;
> /
>
> create or replace procedure p_seq is
> w_id number;
> w_tb varchar2(30);
> w_c varchar2(30);
> w_objseq o_sequence;
> begin
> w_id := 0;
> w_tb := 'mytable';
> w_c := 'mycolumn';
> dbms_output.put_line('Starting...');
> /* initialize the instance of object o_sequence /*
> w_objseq := o_sequence(null,null,null);
> /* calls the procedure with params */
> w_id := w_objseq.get_next_id(w_tb,w_c,w_id);
> dbms_output.put_line(w_id);
> end;
> /
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Apr 26 2000 - 00:00:00 CDT

Original text of this message

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