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: JDBC on JRun & Orace 9i causes "bind variable does not exist"

Re: JDBC on JRun & Orace 9i causes "bind variable does not exist"

From: Edward J. Prochak <ed.prochak_at_magicinterface.com>
Date: Sun, 13 Apr 2003 07:11:31 GMT
Message-ID: <3E991197.60904@magicinterface.com>


sam wrote:
> Hi!
> ------------------------------------------------------------
> java.sql.SQLException: ORA-01006: bind variable does not exist
> ------------------------------------------------------------
>
> This is the msg I get when I try to insert into a database. I want to
> insert a very large value (>4k) into the database using an UPDATE or
> INSERT query and got a "string literal too long" error so decided to
> use bind variables.
>
> The code is as follows: It breaks up the larger value for the column
> into smaller pieces and attempts to update it. Am I doing something
> wrong here? Can someone plz tell me how to do it? Thanx a lot
> !!!!!!!!!!!!!!!!!!!

It likely has nothing to do with your code and everything to do with your table. If the text column is VARCHAR then there is the 4K limit. So the original error message is the thing to fix (not work around).

So for the "string literal too long" error either

  1. your code is exceeding the limits of the column (type is VARCHAR) or
  2. the column can handle the data (type is CLOB) and the JDBC cannot handle large (>4K) strings

You can change your code to never try to insert >4K strings. or
in case 1 change the table column to accept larger strings (change type from VARCHAR to CLOB)
or
in case 2 change the code to send the text in smaller chunks and append to the   data that's there.

I think that covers the possibilities.

-- 
Edward J. Prochak   --- Magic Interface, Ltd.
Ofc: 440-498-3700   --- 7295 Popham Place, Solon, OH 44139
on the web at       --- http://www.magicinterface.com
email: ed.prochak_at_magicinterface.com
Received on Sun Apr 13 2003 - 02:11:31 CDT

Original text of this message

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