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: Oracle Objects initialized by a Tiigger?

Re: Oracle Objects initialized by a Tiigger?

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 10 Dec 1999 08:44:32 -0000
Message-ID: <944815612.21939.2.nnrp-14.9e984b29@news.demon.co.uk>

Harry,

I know it's a long time since you sent this one, and I don't know if you've had a reply since.

I've just got around to looking at it, and there is one possible workaround to the problem. If you set a default value other than NULL for the object then the trigger survives. It's not an ideal solution, but may be enough to solve your problem.

--

Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk

Harry Andree wrote in message <380B5E75.2FF8A247_at_mssm.edu>...
>Hi Everybody,
>
>I've created an object in Oracle 8i.
>
>create or replace type OBJID_TY as object(
> nr number(12),
> ty number(7));
>/
>
>This works. Now I want to have a table that contains this object.
>This works too. Now I want the object to be initialized by a trigger.
>
>CREATE OR REPLACE TRIGGER "WEB"."COMM_TAB_INS"
>BEFORE INSERT ON "COMM_TAB"
>REFERENCING OLD AS old NEW AS new FOR EACH ROW
>begin
> :new.comm_id := objid_ty(1,4);
>end;
>/
>
>comm_id is of the type OBJID_TY. When I try to insert into the
>COMM_TAB table, the following things happen. When we
>pass an object to the insert statement the values get passed and
>the insert works. When we do not provide an object in the
>insert statement the insert fails and SQL plus stops with an
>end-of-communication-channel error. I think it is caused by
>the fact that the :new.comm_id object does not have memory
>allocated. The memory allocated by the trigger seems to
>be freed before the statement is completed.
>
>Does anybody have an idea to solve this problem. We would
>rather not provide every insert statement with the object.
>
>Thanks
>
>Harry Andree
>
>mailto:Harry_Andree_at_mssm.edu
>
Received on Fri Dec 10 1999 - 02:44:32 CST

Original text of this message

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