• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Clobs, Stored procedures and Oracle 8i

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a stored procedure which takes in a Clob as one of IN arguments:

e.g.
PROCEDURE clob_processor(p_c_frag IN CLOB)

I can run the following code against an Oracle 10g database with no problems:

Connection connection = DatabaseHandler.getInstance().getConnection();
CallableStatement statement = connection.prepareCall("call TEST.CLOB_PROCESSOR.clob_processor (?)");
statement.setString("my clob string");
statement.execute;

However, when I run this same code on Oracle 8i I get the following error:

Exception in thread "main" java.sql.SQLException: ORA-06553: P LS-306: wrong number or types of arguments in call to 'CLOB_PROCESSOR'

Unfortunately I cannot find any way to create a CLOB object to encapsulate my String. There are a couple of createTemporary() methods which can do this, but unfortunately they don't seem to work, as I am using an Apache DBCP connection wrapper.

Does anyone know any other way of generating clobs, or obtaining the wrapped connection from within a DBCP wrapper?
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've never used setString() with a CLOB. I've also never created an actual CLOB. Instead I use setAsciiStream() on the prepared statement.
 
I didn't say it. I'm just telling you what this tiny ad said.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic