Sitemap

Amicuk Programming Answers

Implicit conversion of "TEXT" to "VARCHAR"

-0001-11-30   Views:0

Advertisement

Running jdk1.6.0_12, Linux RHE, Sybase 12.5 and connection with jconn3.jar Have a table with a column of type varchar(50) Was able to isolate the problem to this column, as the SQLException was thrown from the line "stmt.setString("@<colname&

Running jdk1.6.0_12, Linux RHE, Sybase 12.5 and connection with jconn3.jar
Have a table with a column of type varchar(50)
Was able to isolate the problem to this column, as the SQLException was thrown from the line "stmt.setString("@<colname>", <value>);"
In doing ~14,000 individual inserts in 30 min I had two Exceptions thrown (Implicit conversion of "TEXT" to "VARCHAR" is not allowed), both at the same place and both repeatable. I put a print statement in the catch block and found that both were inserting the same 6 character string.
Ran all the docs several times more and got the same number of failures on the same files.
Querying the database I found that I had almost 5,000 other insert of the same string which were sucessful.
Not able to identify what was different about the two failures, no unprintable characters, etc.
Is this a JDBC issue or Sybase?
What are the reasons that would cause this exception to be thrown when inserting 6 characters into a hole for 50?
other ideas?
Edited by: jjones3566 on Feb 17, 2009 10:50 AM

The replay answer
Advertisement
jjones3566 wrote:
Running jdk1.6.0_12, Linux RHE, Sybase 12.5 and connection with jconn3.jar
Have a table with a column of type varchar(50)
Was able to isolate the problem to this column, as the SQLException was thrown from the line "stmt.setString("@<colname>", <value>);"
In doing ~14,000 individual inserts in 30 min I had two Exceptions thrown (Implicit conversion of "TEXT" to "VARCHAR" is not allowed), both at the same place and both repeatable. I put a print statement in the catch block and found that both were inserting the same 6 character string.
Ran all the docs several times more and got the same number of failures on the same files.
Querying the database I found that I had almost 5,000 other insert of the same string which were sucessful.That could an invalid assumption. The fact that they displayed the same does not make them the same.
You would need to print the integer value of each character to insure they are the same.
You should do that starting with the source and NOT what is in the database.
If different then that is the source of the problem.
If the same then it is probably just a bug in the driver/database which you are stuck with. Various solutions would be to try a conversion (format the SQL to take a text and convert to varchar) or trying playing with the commit level (commit 50 versus 5000 or whatever.)

Go to See the other 2 answers

Implicit conversion of "TEXT" to "VARCHAR"

Category:DefaultRelease time:-0001-11-30Views:130

Running jdk1.6.0_12, Linux RHE, Sybase 12.5 and connection with jconn3.jar Have a table with a column of type varchar(50) Was able to isolate the problem to this column, as the SQLException was thrown from the line "stmt.setString("@<colname&[More]

Implicit Conversion from data type sql_variant to datetime is not allowed.

Category:DefaultRelease time:-0001-11-30Views:130

 Getting a odd error. This code was working perfectly before a SQLServer upgrade. The linked database is working, I'm able to pull up data from it in separate queries just fine. I'm getting the following error. Implicit conversion from data type sql_[More]

Implicit conversion

Category:DefaultRelease time:-0001-11-30Views:130

doesnot oracle implicitly convert varchar(2) to date in round and trunc functions?Hi, f7218ad2-7d9f-4e71-ba26-0d6e4b38f87e wrote: doesnot oracle implicitly convert varchar(2) to date in round and trunc functions? ROUND and TRUNC do not take VARCHAR2s[More]

When implicit conversion takes place

Category:DefaultRelease time:-0001-11-30Views:130

hi all, I have two queries say sql>SELECT * FROM EMP WHERE HIREDATE BETWEEN '20-FEB-81' AND '20-FEB-82'; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 7566 JO[More]

Error on Implicit conversion

Category:DefaultRelease time:-0001-11-30Views:130

Hey I have a problem to this query, yesterday function normaly, but we reboot the server and now send me this error message: Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value 'sdv' to data type int. this is the qu[More]

Should we replace all implicit conversion by explicit conversion

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, it's my first post in this forum, correct me if I do something incorrect. I just want to discuss this question from the performance point of view, so don't worry about the design or other stuff. I have read through many threads and articles,[More]

Why index is not used if oracle have to do implicit conversion?

Category:DefaultRelease time:-0001-11-30Views:130

my db version: 10gR2 I created bitmap index on each of the column used in below sql. the datatype of all three columns are VARCHAR2, while i am using NUMBER in the query, which means oracle needs to do the implicit conversion before running the sql.[More]

Using currency conversion and text variable at the same time

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, In a 3.5 bex query, i am applying currency conversion on a key figure with a variable of 0currency. as i know, to be able to apply currency conversion, variable of currency should not be in Free characteristics or in Filter. it has to be sele[More]

[svn] 2236: Allow implicit conversion of Vector. * to Vector. T in strict mode.

Category:DefaultRelease time:-0001-11-30Views:130

Revision: 2236<br />Author:   [email protected]<br />Date:     2008-06-25 11:48:59 -0700 (Wed, 25 Jun 2008)<br /><br />Log Message:<br />-----------<br />Allow implicit conversion of Vector.<*> to Vector.<T>[More]

Implicit conversion issue

Category:DefaultRelease time:-0001-11-30Views:130

Dear Sir, Does latest Oracle9i JDBC driver not support implicitly converting string to date? I try to execute "INSERT INTO TABLE DATETYPECOLUMN VALUES '2007-07-24 17:40:00' ". It works well using driver version 9.2.0.1, 9.2.0.3, 9.2.0.4, 9.2.0.5[More]

Disallowed implicit conversion from data type datetime to data type timestamp

Category:DefaultRelease time:-0001-11-30Views:130

Received error: [Macromedia][SQLServer JDBC Driver][SQLServer]Disallowed implicit conversion from data type datetime to data type timestamp, table 'myTbl', column 'duration'. Use the CONVERT function to run this query. I have a field named duration h[More]

Hot
I have a video ipod and a nano. I am trying to get them to share the same library, but am not having any luck. Can anyone let me know how to do this. The video ipod was originally set up on a different library (windows). I de-authorized it, but it wo [More]
I press sync, and it skips syncing music. I try backup restores, and it worked the first time, yet now I restore to multiple previous versions and it deletes certain songs that weren't on before, and it has lagged once it reaches a certain song, and [More]
I am having a performance/lag issues with illustrator CC 2014 and I can't work out why. I use Illustrator on my machine at work and a machine at home. My machine at home is the problem. When I use illustrator on my home computer it lags ever so sligh [More]
I am unable to connect to any secure sites. I downloaded Firefox with the hopes that it would fix the problem but it did not. What ever browser I use I cant connect to any secure sites. All of the other pages load correctly. I have a PC notebook that [More]
Hello, If there are a lot of data from the datasource, the BW will provide many data package during extracting into data target in the SAP-BW. When data were in different data package, I wonder if there is any solution to distiguish the earlies date. [More]
Purpose ========= f60webmx 이 Runaway process 로 남아있을경우 불필요한 자원을 사용할수 있습니다. 이에 대한 조치사항을 기술하고자 합니다. Cause ======= 1. Forms client process (f60webmx ) database server process 와의 socket connection 이 끊겨서 발생하수 있습니다. 2. 어떠한 database server process 도 현재의 Form [More]
Suppose i have a code like this class Demo public static void main(String args[]) System.out.println("We are in First class"); class Demo1 public static void main(String args[]) System.out.println("We are in second class"); In the abov [More]
This is a follow up to [that thread|http://discussions.apple.com/thread.jspa?threadID=1642646]. Problem: Since I'm using Mac OS X the software update notification only appears if you are logged in as an user with administrative rights. In a real mult [More]
Hi, I am running 10gR2 on Windows. Does any one know the steps to change the database which is current in archive mode to noarchive mode? Thanksshutdown immediate startup mount alter database noarchivelog; alter databae open; archvie log list -- to c [More]
I want to create an HTTP session object via a servlet in Apache JServ. This session object contains user profile data as well as session context information. The servlet will redirect the user to the forms6i listener servlet. Can the Forms servlet ac [More]