Thread: [cx-oracle-users] ORA-01461: can bind a LONG value only for insert into a LONG column
Brought to you by:
atuining
From: Vladislav N. <vla...@go...> - 2008-11-07 13:57:33
|
Hello! I have a little question... I'm trying to write a zip file in a oracle db(9.2.x.x)... The Column type is LONG ROW... If the file size is smaller than 10 K, I have no troubles, but if it's more, I get the following error: ORA-01461: can bind a LONG value only for insert into a LONG column The Column can take 70 K Query: insert [TABLE NAME] ( test_column ) values ( utl_raw.cast_to_row([file content]) ) Could you please explain me, how can I avoid this ... Thanks a lot |
From: Shubhanan B. <sb...@et...> - 2012-06-05 01:43:22
|
Hi, I have this strange issue when inserting a unicode string into a varchar2(4000 byte) field. cx_Oracle tries to bind it to a LONG value, however all the characters in the string are English. Table ddl: CREATE TABLE TEST( "NOTES" VARCHAR2(4000 BYTES) ); INSERT INTO TEST (NOTES) VALUES (:NOTES); The python value dict for the above insert is as follows: {'NOTES': u' '} This throws the following error: ORA-01461: can bind a LONG value only for insert into a LONG column Any help will be appreciated. Thanks! Shubhanan |
From: Rodney B. <ba...@pl...> - 2012-06-06 12:42:59
|
Maybe this is the same problem I ran into about a year ago. I posted some patches to the cx_Oracle tests to illustrate: http://sourceforge.net/mailarchive/forum.php?thread_name=001201cc1bd9%248295 5660%2487c00320%24%40com&forum_name=cx-oracle-users I don't know how to fix the problem, but I think I avoided it by converting my unicode values to str. Rodney -----Original Message----- From: Shubhanan Bakre [mailto:sb...@et...] Sent: Monday, June 04, 2012 8:28 PM To: cx-...@li... Subject: [cx-oracle-users] ORA-01461: can bind a LONG value only for insert into a LONG column Hi, I have this strange issue when inserting a unicode string into a varchar2(4000 byte) field. cx_Oracle tries to bind it to a LONG value, however all the characters in the string are English. Table ddl: CREATE TABLE TEST( "NOTES" VARCHAR2(4000 BYTES) ); INSERT INTO TEST (NOTES) VALUES (:NOTES); The python value dict for the above insert is as follows: {'NOTES': u' '} This throws the following error: ORA-01461: can bind a LONG value only for insert into a LONG column Any help will be appreciated. Thanks! Shubhanan ---------------------------------------------------------------------------- -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ cx-oracle-users mailing list cx-...@li... https://lists.sourceforge.net/lists/listinfo/cx-oracle-users |
From: Anthony T. <ant...@gm...> - 2008-11-07 14:40:47
|
Hi, Can you specify what version of cx_Oracle you are using? There have been a few improvements over the years... :-) No matter what version you are using, though, you can always use setinputsizes() to specify. In other words, something like this: cursor.setinputsizes(thevalue = cx_Oracle.LONG_BINARY) cursor.execute("insert into thetable (thecolumn) values (:thevalue)", thevalue = "X" * 60000) That should work for you. You can see some of these techniques in the test suite as well. Anthony On Fri, Nov 7, 2008 at 6:55 AM, Vladislav Nazarenko <vla...@go...> wrote: > Hello! > > I have a little question... I'm trying to write a zip file in a oracle > db(9.2.x.x)... The Column type is LONG ROW... > > If the file size is smaller than 10 K, I have no troubles, but if it's > more, I get the following error: > > ORA-01461: can bind a LONG value only for insert into a LONG column > > The Column can take 70 K > > Query: > insert [TABLE NAME] ( test_column ) values ( utl_raw.cast_to_row([file > content]) ) > > > Could you please explain me, how can I avoid this ... > > Thanks a lot > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |
From: Vladislav N. <vla...@go...> - 2008-11-07 15:05:03
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Hi Anthony,<br> <br> thank you very much for your quick answer... now it works<br> <br> Best regards<br> Vladislav Nazarenko<br> <br> <br> Anthony Tuininga schrieb: <blockquote cite="mid:703...@ma..." type="cite"> <pre wrap="">Hi, Can you specify what version of cx_Oracle you are using? There have been a few improvements over the years... :-) No matter what version you are using, though, you can always use setinputsizes() to specify. In other words, something like this: cursor.setinputsizes(thevalue = cx_Oracle.LONG_BINARY) cursor.execute("insert into thetable (thecolumn) values (:thevalue)", thevalue = "X" * 60000) That should work for you. You can see some of these techniques in the test suite as well. Anthony On Fri, Nov 7, 2008 at 6:55 AM, Vladislav Nazarenko <a class="moz-txt-link-rfc2396E" href="mailto:vla...@go..."><vla...@go...></a> wrote: </pre> <blockquote type="cite"> <pre wrap="">Hello! I have a little question... I'm trying to write a zip file in a oracle db(9.2.x.x)... The Column type is LONG ROW... If the file size is smaller than 10 K, I have no troubles, but if it's more, I get the following error: ORA-01461: can bind a LONG value only for insert into a LONG column The Column can take 70 K Query: insert [TABLE NAME] ( test_column ) values ( utl_raw.cast_to_row([file content]) ) Could you please explain me, how can I avoid this ... Thanks a lot ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world <a class="moz-txt-link-freetext" href="http://moblin-contest.org/redirect.php?banner_id=100&url=/">http://moblin-contest.org/redirect.php?banner_id=100&url=/</a> _______________________________________________ cx-oracle-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:cx-...@li...">cx-...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/cx-oracle-users">https://lists.sourceforge.net/lists/listinfo/cx-oracle-users</a> </pre> </blockquote> <pre wrap=""><!----> ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world <a class="moz-txt-link-freetext" href="http://moblin-contest.org/redirect.php?banner_id=100&url=/">http://moblin-contest.org/redirect.php?banner_id=100&url=/</a> _______________________________________________ cx-oracle-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:cx-...@li...">cx-...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/cx-oracle-users">https://lists.sourceforge.net/lists/listinfo/cx-oracle-users</a> </pre> </blockquote> <br> </body> </html> |