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
We have a requirement to determine the receivers of the message dynamically at runtime. From one of the blog I i got the how to do material. I have created the receivers according to age. <?xml version="1.0" encoding="UTF-8"?> &l [More]
Hi, i've downloaded the latest from the Flex SVN trunk, and built it with Ant in every way I can possibly think of (after running Ant -projecthelp).  I have Flex 4.5 configured as my Flex SDK in Flex Builder 3, but since playerglobal.swc is not there [More]
Hi, My company has SAP HR Configuration setup... When I execute an action "Terminated" for an employee a group of ITs are triggered (0014, 0015, 0026) and after saving them i still see the employee Active in IT 0001. Can any one help me out with [More]
my ipod shows a sign like a cross with a circle, what do that mean?Hey mgm2807, Does this describe what you are seeing on your iPod? iPod Displays a Red "X" Icon http://support.apple.com/kb/ts1463 Thanks for using the Apple Support Communities. [More]
I am shooting some video for a company who wants me to upload the video to their website afterwards. I don;t want to have to "upload" to my iMac and then transfer it to the website, but go directly from camera to website through the iMac. The we [More]
Hi there! I want to resize the column of a JTable(constructed via AbstractTableModel) to fit the exact width of the word in the header? Can anyone tell me how to do this thing? Regards,import java.awt.*; import javax.swing.table.*; public class Colum [More]
Trying to configure Version 11 and get the error: "Shared Services database content not found in the specified database". Relevant details on my issue as below: - I'm running Windows 7 and SQL Server 2008 on my local machine. - I did have a prev [More]
Hi - I've just started using Policy Server and am trying to connect to it using the SDK. I've got a very small amount of source code which I took from the API documentation which should literally create the properties & then calls EDCFactory.connect. [More]
Around 0200 almost everyday I get a message: Acrobat distiller has encountered a problem and needs to close. When I go into the event view (my computer/manage) I see faulting application acrodist.exe, version 8.1.3.187 faulting module acrodist.dll, v [More]
I'm in my project in Premiere Pro and trying to use Dynamic Link for the first time so I can edit in After Effects. I right click on my clip and see where I could potentially click "replace with after effects composition" but it will not allow m [More]