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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers, UTL_TCP

Re: Triggers, UTL_TCP

From: Jim Kennedy <jim>
Date: Thu, 7 Sep 2006 19:50:03 -0700
Message-ID: <KemdnXuTvtkKRJ3YnZ2dnUVZ_q6dnZ2d@comcast.com>

"schw" <schwartz_at_alpha.net.pl> wrote in message news:1157629048.364161.268730_at_e3g2000cwe.googlegroups.com...
> hmm good point.
>
> using job is looking very promising but I found it difficult to pass
> :new and :old parameters into the job context, how can I do it?
>
> thanks
> schw
>
>
> Jim Kennedy wrote:
> > "schw" <schwartz_at_alpha.net.pl> wrote in message
> > news:1157532611.072135.100280_at_i42g2000cwa.googlegroups.com...
> > > Hi,
> > >
> > > I've encountered a problem that is caused by lack of my Oracle
> > > knowledge. Please help
> > >
> > > Here are details:
> > >
> > > I've got a java TCP/IP based server that listens on specified port. In
> > > my row-level type triggers (delete action) I connect to the server
> > > using UTL_TCP and using very simple protocol I want to send column
> > > values that users selected.
> > >
> > > e.g.
> > >
> > > DECLARE
> > > c utl_tcp.connection; -- TCP/IP connection to the Web server
> > > n number;
> > > BEGIN
> > > c := utl_tcp.open_connection('localhost',1232 ); -- open
> > > connection
> > > n := utl_tcp.write_line(c, 'SET NAME1 SIZE=XX');
> > > n := utl_tcp.write_line(c, :old:column1);
> > > utl_tcp.close_connection(c);
> > > END;
> > >
> > > User wants to send :old:column1 to the server.
> > >
> > > The problem is that :old:column1 might be any data type. How can I
> > > convert any type to string or maybe to RAW type (and then I could use
> > > write_raw method)? How can I get size of data?
> > >
> > > thanks for any help
> > >
> > > best regards
> > > schw
> > >
> > So you want to notify something even if a row is deleted and rolled
back?
> > Then you would get a false delete. The external application would the
row
> > was deleted but in fact it wasn't. You would be better calling a stored
> > proc that added a dbms_job to send the tcp message. If there is a
commit
> > then the message will be sent. If there is a rollback then the dbms_job
is
> > not run and so the message won't be sent.
> > Jim
>

Pass them as arguments to the stored procedure. Jim Received on Thu Sep 07 2006 - 21:50:03 CDT

Original text of this message

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