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: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 06 Sep 2006 06:52:35 -0700
Message-ID: <1157550752.678974@bubbleator.drizzle.com>


schw wrote:
> 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

And your Oracle version is?

Assuming 9i or above, go to Morgan's Library at www.psoug.org and click on ANYDATA DATA TYPE.

Alternatively you could create a user defined data type that send the value as a string and has a second component, also a string, that identifies the originating data type.

-- 
Puget Sound Oracle Users Group
Received on Wed Sep 06 2006 - 08:52:35 CDT

Original text of this message

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