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: HOWTO create BinaryStream-Results for XML?

Re: HOWTO create BinaryStream-Results for XML?

From: Thomas Frankewitsch <franket_at_medsnt01.uni-muenster.de>
Date: Wed, 29 Sep 1999 23:25:48 +0200
Message-ID: <7su099$qai$1@redenix.uni-muenster.de>


thanks for that useful hint, but it involves a further (seems to be a stupid one) question:

I've experienced that creating a Clob needs a table from which it can be derived

.. insert into table .. Clob-dummy for example - code fragments

      String cmd = "Insert Into mmo_text Values ('"+ mediaid+ "','nix'," + "'1')";

      System.err.println(cmd);
      OraclePreparedStatement pstmt = (OraclePreparedStatement)
connection.prepareStatement(cmd);
      pstmt.execute();
      pstmt.close();
      try{
        Statement stmt = connection.createStatement();
        ResultSet rset = stmt.executeQuery ("SELECT MEDIA FROM MMO_TEXT
WHERE MEDIA_ID = "+mediaid);
        if (rset.next ())

          CLOB clob = ((OracleResultSet)rset).getCLOB (1);

    Writer outstream = clob.getCharacterOutputStream();

     write to that stream,

but how can one create a stream from the "egg" :?-) how creating a new clob, only for itself, to have a result for the function, which can be passed back to the calling JDBC-Partner?

I hope somebody just knows where Oracle has stored this documentation ???

thomas

CRAY_k schrieb in Nachricht ...
>For writing in LONG fields tou can't do that with PL/SQL, you must use OCI
>API !!
>But !
>you can also use CLOB fields (Ora8) to store XML and retrieve the value
with
>classic SQL queries but these (you driver or application) must support CLOB
>fields (in ...OCI 8)
>
>OCI is the only way !
>
>Thomas Frankewitsch <franket_at_medsnt01.uni-muenster.de> wrote in message
>news:7ssh4g$ka4$1_at_redenix.uni-muenster.de...
>> Hi all,
>>
>> just a question I've spent a lot of time...
>>
>> I want to create a stored procedure which should be a XML result.
>> I've tried this with a java-procedure loaded into the server.
>>
>> Ther I've found, that Varchr2 is to small :-(, using an Java-Outputstream
>> (registered in PL-SQL as LONG) is also cutted after 4096 chars :-(((((
>>
>> It shoudl be possibel to do that, because ORDIMG can!
>>
>> I didn't want to use the web-Server-module which can handle longer
>> outputstreams, I'just want to send back a long, long stream of about 20
>KB!
>>
>> thanks in advance
>>
>> thoma
>>
>>
>
>
Received on Wed Sep 29 1999 - 16:25:48 CDT

Original text of this message

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