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: package variables

Re: package variables

From: stephen O'D <stephen.odonnell_at_gmail.com>
Date: 24 Jan 2006 13:34:09 -0800
Message-ID: <1138138449.069781.44210@g14g2000cwa.googlegroups.com>


Antonio 6sette wrote:

> I have an object:
>
> CREATE OR REPLACE TYPE o_societa UNDER object_arc (
> DESCR VARCHAR2(50),
> CONSTRUCTOR FUNCTION o_societa RETURN SELF AS RESULT,
> OVERRIDING MEMBER PROCEDURE seleziona,
> OVERRIDING MEMBER PROCEDURE stampa_elenco
> );
>
> In a PLSQL block I declare:
>
> CREATE OR REPLACE PACKAGE BODY apkg_arc AS
> oggetto_arc object_arc;
>
> PROCEDURE seleziona (arc VARCHAR2, funz VARCHAR2) AS
> BEGIN
> IF arc = 'societa' THEN
> oggetto_arc := o_societa;
> END IF;
>
> -- write a web form with PROCEDURE stampa_elenco
> -- as target
> oggetto_arc.seleziona;
> ....
> END;
>
> PROCEDURE stampa_elenco (name_array owa.vc_arr,
> value_array owa.vc_arr) AS
> BEGIN
> -- oggetto_arc := o_societa;
> htp.header(1,'ID => '||oggetto_arc.id);
>
> oggetto_arc.stampa_elenco;
> ...
> END;
>
> but in 'stampa_elenco' i got
>
> ORA-30625: method dispatch on NULL SELF argument is disallowed
>
> if I renitialize oggetto_arc in 'stampa_elenco', its work but ...
> the global var 'oggetto_arc' does not mantain the initialization made in
> 'seleziona' ??
>
> tanks in advance ...
>
> --
> #include <stdio.h>
> int main(void){char c[]={10,65,110,116,111,110,105,111,32,98,97,114,98,111,110,
> 101,32,60,104,105,110,100,101,109,105,116,64,116,105,115,99,97,108,105,110,101,
> 116,46,105,116,62,10,10,0};printf("%s",c);return 0;}

Are you creating a webpage with the first procedure 'seleziona' and setting the action tag :
like:

<form action="apkg_arc.stampa_elenco">
...

So that the procedure apkg_arc.stampa_elenco is used to process the input?

The reason the global variable is not initialised is that when the procedure stampa_elenco is called, it is called in a brand new session as if you have just logged in. After Oracle generated the webpage with the first procedure, the package state is reset clearing any global variables etc. This is why simple web applications like this are known as stateless. Received on Tue Jan 24 2006 - 15:34:09 CST

Original text of this message

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