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've looked at the other discussions about not being able to insert pages into a PDF, and tried all the suggestions, but to no avail. I think the problem is that the original PDF was created in Adobe 8, and I have Adobe 9. When I open the PDF in Adob [More]
Hi Everyone We have a business requirement moving to 2012R2 RDSH server. I have installed a 2012R2 member servers and enabled Remote desktop licensing role. I have activated the licenses. the servers is in operational I have deployed 3 windows 2012R2 [More]
Hi all,    How can i find that which FMs or BAPIs are called from the Portal Services to get the Time accounts for the Leave Request Appl on ESS. The problem which i have to investigate is that on IT2006 the balance is different and on Portal the bal [More]
Hi, i would like to know , How can i clear the signature by using java script in adobe X11 i have button , once i click on the button particular signature must be cleared. Any suggestion will help.Just reset it, like so: this.resetForm(["Signature1&q [More]
How do I change the name of my rooms in the app? Also, when I try to move some devices from one room to another, it doesn't give all of the rooms as an option, why not?Level names can be reused across dimensions. This is common. For example, detail l [More]
We have to use a group by into a request from an oracle database : SELECT SUBSTR(ETETAFI,0,6) ||'0' ||' ' ||' ' ||MAX(SUBSTR(ETETAFI,13,35)) ||RPAD(TO_CHAR(SUM(TO_NUMBER(SUBSTR(ETETAFI,48,16)))),16,' ') ||RPAD(TO_CHAR(SUM(TO_NUMBER(SUBSTR(ETETAFI,64, [More]
hey ! i m an exchange student in the US for the year, so i have alot of pics ...i decided to buy the ipod 30go video to save my pics, because my host family's computer doesn t have a cd burner and my pics are on the computer. it s a windows 98 so my [More]
Hi all,        I have a scenario like below.O/P condition type OPT has to be determined in Delivery header based on the Payer.        I read the IMG-S&D-SYS.MOD-New fields for O/P Determ with Condition technique. Based on that i added the Payer Field [More]
I need some help. Can some please explain what i am doing wrong here. i have created a Dll from a LV 7.0 vi. The header file looks something like this: typedef struct { long dimSize; double elt[1]; } TD2; typedef TD2 **TD2Hdl; typedef struct { double [More]
My children have each a zen V, which easliy charges from the USB on the PC. However, I did an attempt to chrage with my uni'versal usb power supply which I use for my cell-phone pda (which of course is also possible to charge from the usb on the pc) [More]