[cx-oracle-users] can bind a LONG value only for insert into a LONG
Brought to you by:
atuining
From: Robert L. <rlu...@pi...> - 2012-07-01 10:05:02
|
>issue when inserting a unicode string into a varchar2(4000 byte) field When you create a VARCHAR2 you can specify "BYTE" or "CHAR". So, trying to put unicode into a "BYTE" varchar2 I think is wrong because unicode definitely takes more than one byte. For the official doco, check out http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements001.htm#i4 5694 Oracle Built-in Datatypes Table 2-1 Built-in Datatype Summary VARCHAR2(size [BYTE | CHAR]) Variable-length character string having maximum length size bytes or characters. Maximum size is 4000 bytes or characters, and minimum is 1 byte or 1 character. You must specify size for VARCHAR2. BYTE indicates that the column will have byte length semantics; CHAR indicates that the column will have character semantics. The other thing is to step back and ask, does the DB support unicode? A good place to start is http://docs.oracle.com/cd/B19306_01/server.102/b14225/ch6unicode.htm Please try to avoid "hacking" so that a non-unicode Oracle db is used to support unicode. It is "simple" to upgrade the character set of the database. -----Original Message----- From: cx-...@li... [mailto:cx-...@li...] Sent: Saturday, June 30, 2012 10:47 PM To: cx-...@li... Subject: cx-oracle-users Digest, Vol 72, Issue 1 Send cx-oracle-users mailing list submissions to cx-...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/cx-oracle-users or, via email, send a message with subject or body 'help' to cx-...@li... You can reach the person managing the list at cx-...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of cx-oracle-users digest..." Today's Topics: 1. ORA-01461: can bind a LONG value only for insert into a LONG column (Shubhanan Bakre) 2. Re: ORA-01461: can bind a LONG value only for insert into a LONG column (Rodney Barnett) 3. Next Release? (ba...@pl...) 4. Re: Next Release? (Anthony Tuininga) 5. Re: Next Release? (Rodney Barnett) 6. 'ImportError: DLL load failed' only happens with Apache WSGI (Michael Freylinger) 7. Re: Next Release? (Anthony Tuininga) ---------------------------------------------------------------------- Message: 1 Date: Mon, 4 Jun 2012 20:27:58 -0500 From: Shubhanan Bakre <sb...@et...> Subject: [cx-oracle-users] ORA-01461: can bind a LONG value only for insert into a LONG column To: "cx-...@li..." <cx-...@li...> Message-ID: <EF1...@MB...> Content-Type: text/plain; charset="us-ascii" 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 ------------------------------ Message: 2 Date: Wed, 6 Jun 2012 07:42:45 -0500 From: "Rodney Barnett" <ba...@pl...> Subject: Re: [cx-oracle-users] ORA-01461: can bind a LONG value only for insert into a LONG column To: <cx-...@li...> Message-ID: <006e01cd43e1$df8c9f50$9ea5ddf0$@com> Content-Type: text/plain; charset="us-ascii" 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 ------------------------------ Message: 3 Date: Wed, 13 Jun 2012 14:08:35 -0400 (EDT) From: ba...@pl... Subject: [cx-oracle-users] Next Release? To: cx-...@li... Message-ID: <378...@ma...> Content-Type: text/plain;charset=iso-8859-1 Hi, Is there a release on the horizon? A client could benefit from recent changes and it would be easier to work with a released version. Thanks. Rodney ------------------------------ Message: 4 Date: Wed, 13 Jun 2012 23:20:34 -0600 From: Anthony Tuininga <ant...@gm...> Subject: Re: [cx-oracle-users] Next Release? To: cx-...@li... Message-ID: <CAE...@ma...> Content-Type: text/plain; charset=ISO-8859-1 Hi Rodney, Yes, I really should make a new release as it is has been some time since the last one and there are some changes that could be released. I'll see about getting one out in the next couple of weeks. I'd say sooner than that but the next week looks particularly busy. :-( Hope that works for you. Anthony On Wed, Jun 13, 2012 at 12:08 PM, <ba...@pl...> wrote: > Hi, > > Is there a release on the horizon? ?A client could benefit from recent > changes and it would be easier to work with a released version. > > Thanks. > > Rodney > > > -------------------------------------------------------------------------- ---- > 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 ------------------------------ Message: 5 Date: Thu, 14 Jun 2012 07:47:18 -0500 From: "Rodney Barnett" <ba...@pl...> Subject: Re: [cx-oracle-users] Next Release? To: <cx-...@li...> Message-ID: <003101cd4a2b$d59b0d10$80d12730$@com> Content-Type: text/plain; charset="iso-8859-1" That should work. Thanks. Rodney -----Original Message----- From: Anthony Tuininga [mailto:ant...@gm...] Sent: Thursday, June 14, 2012 12:21 AM To: cx-...@li... Subject: Re: [cx-oracle-users] Next Release? Hi Rodney, Yes, I really should make a new release as it is has been some time since the last one and there are some changes that could be released. I'll see about getting one out in the next couple of weeks. I'd say sooner than that but the next week looks particularly busy. :-( Hope that works for you. Anthony On Wed, Jun 13, 2012 at 12:08 PM, <ba...@pl...> wrote: > Hi, > > Is there a release on the horizon? ?A client could benefit from recent > changes and it would be easier to work with a released version. > > Thanks. > > Rodney > > > ---------------------------------------------------------------------------- -- > 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 ---------------------------------------------------------------------------- -- 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 ------------------------------ Message: 6 Date: Wed, 20 Jun 2012 16:49:16 +0200 From: Michael Freylinger <mic...@gm...> Subject: [cx-oracle-users] 'ImportError: DLL load failed' only happens with Apache WSGI To: cx-...@li... Message-ID: <CAO4poPhoEv70Omghn7WaDfcYE9pGL_uWO7SOJebGW=PSO...@ma...> Content-Type: text/plain; charset=ISO-8859-1 Hi everybody, I can import cx_Oracle from Python console. I can import cx_Oracle from a CGI script run by Apache (and I can connect to my database and run SQL queries). But I CANNOT import cx_Oracle from a WSGI script run by Apache. Apache logs the error 'ImportError: DLL load failed: The specified module could not be found.' 'import cx_Oracle' is the first statement of my CGI and WSGI script. I printed the os.environ in both CGI and WSGI scripts and the only Oracle related stuff is in variable PATH which contains 'C:\oraclexe\app\oracle\product\11.2.0\server\bin', which is present in both cases. So what could be different in WSGI that makes the import fail? Software: Operating system = 'Windows-XP-5.1.2600-SP3' Python version = '2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]' SERVER_SOFTWARE = Apache/2.2.22 (Win32) mod_wsgi/3.3 Python/2.7.3 cx_Oracle module version = '5.1.1' Oracle client version = (11, 2, 0, 2, 0) ------------------------------ Message: 7 Date: Sat, 30 Jun 2012 21:47:11 -0600 From: Anthony Tuininga <ant...@gm...> Subject: Re: [cx-oracle-users] Next Release? To: cx-...@li... Message-ID: <CAE1XR-7ZEFLTzVNAB+HFo2hgibeWNexduM3pCtwQ_=+xk...@ma...> Content-Type: text/plain; charset=ISO-8859-1 Hi Rodney, I have run into some difficulties with my virtual machines due to some upgrades and the fact that I haven't used them for some time! So things have been delayed longer than expected.... :-( Should have them resolved shortly, though. Depending on which Python version and OS you require, though, I can focus on resolving the difficulties with that one first instead of the others. Anthony On Thu, Jun 14, 2012 at 6:47 AM, Rodney Barnett <ba...@pl...> wrote: > That should work. ?Thanks. > > Rodney > > -----Original Message----- > From: Anthony Tuininga [mailto:ant...@gm...] > Sent: Thursday, June 14, 2012 12:21 AM > To: cx-...@li... > Subject: Re: [cx-oracle-users] Next Release? > > Hi Rodney, > > Yes, I really should make a new release as it is has been some time > since the last one and there are some changes that could be released. > I'll see about getting one out in the next couple of weeks. I'd say > sooner than that but the next week looks particularly busy. :-( Hope > that works for you. > > Anthony > > On Wed, Jun 13, 2012 at 12:08 PM, ?<ba...@pl...> wrote: >> Hi, >> >> Is there a release on the horizon? ?A client could benefit from recent >> changes and it would be easier to work with a released version. >> >> Thanks. >> >> Rodney >> >> >> > -------------------------------------------------------------------------- -- > -- >> 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 > > -------------------------------------------------------------------------- -- > -- > 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 > > > -------------------------------------------------------------------------- ---- > 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 ------------------------------ ---------------------------------------------------------------------------- -- 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 End of cx-oracle-users Digest, Vol 72, Issue 1 ********************************************** |