Re: cx_Oracle problem

2009-09-15 Thread Squid
On Sep 15, 9:45 am, Squid wrote: > It's time for another round of "stump-the-geek". (thats what we call > it in my office) > > If actual code is needed I can provide but lets start off small for > this one... > > I've got a Python script that uses cx_Oracle to access an Oracle DB. > running the sc

cx_Oracle problem

2009-09-15 Thread Squid
It's time for another round of "stump-the-geek". (thats what we call it in my office) If actual code is needed I can provide but lets start off small for this one... I've got a Python script that uses cx_Oracle to access an Oracle DB. running the script from command line runs perfect running the

Re: Unicode / cx_Oracle problem

2006-09-16 Thread John Machin
Richard Schulman wrote: > On 10 Sep 2006 15:27:17 -0700, "John Machin" <[EMAIL PROTECTED]> > wrote: > > >... > >Encode each Unicode text field in UTF-8. Write the file as a CSV file > >using Python's csv module. Read the CSV file using the same module. > >Decode the text fields from UTF-8. > > > >Y

Re: Unicode / cx_Oracle problem

2006-09-16 Thread Richard Schulman
On 10 Sep 2006 15:27:17 -0700, "John Machin" <[EMAIL PROTECTED]> wrote: >... >Encode each Unicode text field in UTF-8. Write the file as a CSV file >using Python's csv module. Read the CSV file using the same module. >Decode the text fields from UTF-8. > >You need to parse the incoming line into c

Re: Unicode / cx_Oracle problem

2006-09-10 Thread John Machin
Richard Schulman wrote: > On Sun, 10 Sep 2006 11:42:26 +0200, "Diez B. Roggisch" > <[EMAIL PROTECTED]> wrote: > > >What does print repr(mean) give you? > > That is a useful suggestion. > > For context, I reproduce the source code: > > in_file = codecs.open("c:\\pythonapps\\mean.my",encoding="utf_16

Re: Unicode / cx_Oracle problem

2006-09-10 Thread Diez B. Roggisch
> Value of the variable 'id' is u'\ufeff' > Value of the variable 'mean' is u'(' So they both are unicode objects - as I presumed. > It's very hard to figure out what to do on the basis of complexities > on the order of > > http://download-east.oracle.com/docs/cd/B25329_01/doc/appdev.102/b251

Re: Unicode / cx_Oracle problem

2006-09-10 Thread Richard Schulman
On Sun, 10 Sep 2006 11:42:26 +0200, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >What does print repr(mean) give you? That is a useful suggestion. For context, I reproduce the source code: in_file = codecs.open("c:\\pythonapps\\mean.my",encoding="utf_16_LE") connection = cx_Oracle.connect("us

Re: Unicode / cx_Oracle problem

2006-09-10 Thread Diez B. Roggisch
Richard Schulman schrieb: >>> cursor.execute("""INSERT INTO mean (mean_id,mean_eng_txt) >>> VALUES (:id,:mean)""",id=id,mean=mean) >>> ... >>> "cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data >>> type unicode" >>> >>> But when I try putting a codecs.BOM_UTF16_LE in variou

Re: Unicode / cx_Oracle problem

2006-09-09 Thread Richard Schulman
>> cursor.execute("""INSERT INTO mean (mean_id,mean_eng_txt) >> VALUES (:id,:mean)""",id=id,mean=mean) >>... >> "cx_Oracle.NotSupportedError: Variable_TypeByValue(): unhandled data >> type unicode" >> >> But when I try putting a codecs.BOM_UTF16_LE in various plausible >> places, I just end

Re: Unicode / cx_Oracle problem

2006-09-09 Thread Diez B. Roggisch
Richard Schulman schrieb: > Sorry to be back at the goodly well so soon, but... > > ...when I execute the following -- variable mean_eng_txt being > utf-16LE and its datatype nvarchar2(79) in Oracle: > > cursor.execute("""INSERT INTO mean (mean_id,mean_eng_txt) > VALUES (:id,:mean)""",id=id

Unicode / cx_Oracle problem

2006-09-08 Thread Richard Schulman
Sorry to be back at the goodly well so soon, but... ...when I execute the following -- variable mean_eng_txt being utf-16LE and its datatype nvarchar2(79) in Oracle: cursor.execute("""INSERT INTO mean (mean_id,mean_eng_txt) VALUES (:id,:mean)""",id=id,mean=mean) I not surprisingly get this