Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-10-24 Thread David

I use the same sample in the new release of Mono 1.1.18 upgrading by yast

and it said:
Error is: ORA-01480: trailing null missing from STR bind value

Same error in my Website (mono+oracle)

These are my settings

[EMAIL PROTECTED]:~> env | grep LANG
NLS_LANG=simplified chinese_china.UTF8
LANG=zh_CN.UTF-8

PARAMETERVALUE

---
NLS_LANGUAGE
SIMPLIFIED CHINESE
NLS_TERRITORYCHINA
NLS_CURRENCY 锟?

NLS_ISO_CURRENCY CHINA
NLS_NUMERIC_CHARACTERS   .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT  DD-MON-RR
NLS_DATE_LANGUAGE
SIMPLIFIED CHINESE
NLS_CHARACTERSET UTF8
NLS_SORT BINARY
NLS_TIME_FORMAT  HH.MI.SSXFF AM

PARAMETERVALUE

---
NLS_TIMESTAMP_FORMAT
DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT
HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT
DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY锟?

NLS_NCHAR_CHARACTERSET UTF8
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP  FALSE
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-10-04 Thread Leszek Ciesielski
On 10/4/06, David <[EMAIL PROTECTED]> wrote:
> 2006/10/4, David <[EMAIL PROTECTED]>:
> > > On the other hand - after reading other people's mail, it seems to me
> > > that all who experience the trimming have Oracle database setup as
> > > UTF8. Mine works in EEMSWIN1250 (you can check this with "SELECT value
> > > FROM nls_database_parameters WHERE parameter='NLS_CHARACTER_SET';").
> >
> > No, you're wrong
> > At First, I use ZHS16GBK and I find the bug
> > then i turn to utf8, the problem still exists
> > but I didn't test EEMSWIN1250 at all
> >
>
> And I find the trimming bug only in my Chinese string,
> if you input totally engish string, the bug will not happen

Ok, but ZHS16GBK is still a double byte per character encoding. So
maybe I was not precise enough, but it seems we still have two bugs:
one with trimming multibute characters (which happens when databse is
capable of storing them as normal CHARs), the other with replacing
them with '?' (when the database cannot store them as CHAR, but still
should process them correctly as NCHAR). And as I do not have the
administration rights on the database I use for tests (and can not
change the encoding), I'll have to cope with mine bug first before I
can even test yours.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-10-04 Thread David
2006/10/4, David <[EMAIL PROTECTED]>:
> > On the other hand - after reading other people's mail, it seems to me
> > that all who experience the trimming have Oracle database setup as
> > UTF8. Mine works in EEMSWIN1250 (you can check this with "SELECT value
> > FROM nls_database_parameters WHERE parameter='NLS_CHARACTER_SET';").
>
> No, you're wrong
> At First, I use ZHS16GBK and I find the bug
> then i turn to utf8, the problem still exists
> but I didn't test EEMSWIN1250 at all
>

And I find the trimming bug only in my Chinese string,
if you input totally engish string, the bug will not happen
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-10-04 Thread David
> On the other hand - after reading other people's mail, it seems to me
> that all who experience the trimming have Oracle database setup as
> UTF8. Mine works in EEMSWIN1250 (you can check this with "SELECT value
> FROM nls_database_parameters WHERE parameter='NLS_CHARACTER_SET';").

No, you're wrong
At First, I use ZHS16GBK and I find the bug
then i turn to utf8, the problem still exists
but I didn't test EEMSWIN1250 at all
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-10-02 Thread Leszek Ciesielski
On 10/2/06, Daniel Morgan <[EMAIL PROTECTED]> wrote:
> Yeah, I tried looking at it the other day, but I have
> no idea how to test unicode stuff.
>
> Maybe eno on GimpNet IRC #mono can help you.  He may
> not be able to help with Oracle, but he knows unicode
> very well.  jonp is another good person to to talk to.
>
> If possible, write a Windows.Forms application with a
> rich text box or a Gtk# application with a TextView
> and output your result there.  This is so unicode
> characters will show up for you.
>
> When looking at the output in a MS DOS Command Prompt,
> all I get is ? (question marks) as well.
>
> Also, Oracle SQL Developer is a good oracle GUI tool
> which is free to download and use.  It uses JDK 1.5
> (JRE 1.5 will not work).  This tool shows the unicode
> characters.
>
> --- Leszek Ciesielski <[EMAIL PROTECTED]> wrote:
>
> > I have started (finally!) to work on this bug. The
> > test I am currently
> > using fails, with or without patch... although in an
> > unexpected way.
> >
> > On mono, it breaks with:
> >
> > Failures:
> > 1)
> >
> MonoTests.System.Data.OracleClient.Oci.OciDefineHandleTest.TrimsWideUnicodeStringsTest
> > : Directly passed value mismatched
> > String lengths are both 25.
> > Strings differ at index 2.
> >
> > expected:<"chㄼar入act本ers插 utf8
> > l日ong">
> >  but was:<"ch?ar?act?ers? utf8 l?ong">
> > -^
> >
> > (If your PC does not render east-asian fonts - upper
> > line contains
> > some japanese and chinese glyphs, in the lower they
> > are replaced by
> > question marks.)
> > The string doesn't get trimmed. I suppose this is a
> > problem with the
> > setup of my Oracle database.
> > To verify, I tried to run the code on MS.Net 1.1. It
> > breaks... with
> > OracleException Ora 12571:TNS:packket writer
> > failure. Any sugestions?
> > I attach the regression for bug 78840.
My mistake, a followin mail didn't make it to the list. So:

Gr8. At least I know why I have problems getting this to work on MS.Net:
it won't work. (see
http://support.microsoft.com/default.aspx?scid=kb;en-us;322158# ) I'd
have to use their exact versions of Oracle8, none other are basicly
supported... so cross-testing this problem on windows is not possible.
On the other hand - after reading other people's mail, it seems to me
that all who experience the trimming have Oracle database setup as
UTF8. Mine works in EEMSWIN1250 (you can check this with "SELECT value
FROM nls_database_parameters WHERE parameter='NLS_CHARACTER_SET';").
This, however, should not be an issue, as NVARCHAR2 is meant for
storing Unicode data even when the database does not operate in UTF8
(consult 
http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10749/ch6unicode.htm#i1007039).
So there is ANOTHER bug, this one presenting only with non-UTF8
databases... Oh shit. Somewhere before the string gets inserted, mono
(or OCI) replaces all non-ascii chars with character number 63 (yes,
the question mark).

[btw - I read the results through nunit gui runner, or KDE Konsole,
both of which display UTF8 fine.]
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-10-02 Thread Daniel Morgan
Yeah, I tried looking at it the other day, but I have
no idea how to test unicode stuff.

Maybe eno on GimpNet IRC #mono can help you.  He may
not be able to help with Oracle, but he knows unicode
very well.  jonp is another good person to to talk to.

If possible, write a Windows.Forms application with a
rich text box or a Gtk# application with a TextView
and output your result there.  This is so unicode
characters will show up for you.  

When looking at the output in a MS DOS Command Prompt,
all I get is ? (question marks) as well.

Also, Oracle SQL Developer is a good oracle GUI tool
which is free to download and use.  It uses JDK 1.5
(JRE 1.5 will not work).  This tool shows the unicode
characters.

--- Leszek Ciesielski <[EMAIL PROTECTED]> wrote:

> I have started (finally!) to work on this bug. The
> test I am currently
> using fails, with or without patch... although in an
> unexpected way.
> 
> On mono, it breaks with:
> 
> Failures:
> 1)
>
MonoTests.System.Data.OracleClient.Oci.OciDefineHandleTest.TrimsWideUnicodeStringsTest
> : Directly passed value mismatched
> String lengths are both 25.
> Strings differ at index 2.
> 
> expected:<"chㄼar入act本ers插 utf8
> l日ong">
>  but was:<"ch?ar?act?ers? utf8 l?ong">
> -^
> 
> (If your PC does not render east-asian fonts - upper
> line contains
> some japanese and chinese glyphs, in the lower they
> are replaced by
> question marks.)
> The string doesn't get trimmed. I suppose this is a
> problem with the
> setup of my Oracle database.
> To verify, I tried to run the code on MS.Net 1.1. It
> breaks... with
> OracleException Ora 12571:TNS:packket writer
> failure. Any sugestions?
> I attach the regression for bug 78840.
> > ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
>
http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-10-02 Thread Leszek Ciesielski

I have started (finally!) to work on this bug. The test I am currently
using fails, with or without patch... although in an unexpected way.

On mono, it breaks with:

Failures:
1) 
MonoTests.System.Data.OracleClient.Oci.OciDefineHandleTest.TrimsWideUnicodeStringsTest
: Directly passed value mismatched
   String lengths are both 25.
   Strings differ at index 2.

   expected:<"chㄼar入act本ers插 utf8 l日ong">
but was:<"ch?ar?act?ers? utf8 l?ong">
   -^

(If your PC does not render east-asian fonts - upper line contains
some japanese and chinese glyphs, in the lower they are replaced by
question marks.)
The string doesn't get trimmed. I suppose this is a problem with the
setup of my Oracle database.
To verify, I tried to run the code on MS.Net 1.1. It breaks... with
OracleException Ora 12571:TNS:packket writer failure. Any sugestions?
I attach the regression for bug 78840.


OciDefineHandleTest.cs
Description: Binary data
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-27 Thread Jörg Rosenkranz
2006/9/26, Leszek Ciesielski <[EMAIL PROTECTED]>:
> It would be nice to use GetBytesCount() instead, but that would
> require knowing the exact string we are going to bind - which we don't
> know. (Correct me if I'm wrong)

I haven't found an OCI function for this yet.

Joerg.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-27 Thread Jörg Rosenkranz
Sorry, I don't have a Linux system with Mono build environment here.
That's why I couldn't build it yet. Maybe someone other can provide
you a patched DLL?

Joerg.

2006/9/27, David <[EMAIL PROTECTED]>:
> Cound you give me a pathed OracleClient.dll,so I can test my project ?
>
> 2006/9/26, Leszek Ciesielski <[EMAIL PROTECTED]>:
> > On 9/26/06, Jörg Rosenkranz <[EMAIL PROTECTED]> wrote:
> > > Hi all,
> > >
> > > I have attached a patch which should fix this problem.
> > > Please check that it runs correctly because I can not build and test
> > > this patch here.
> > >
> > > Joerg.
> > >
> > > 2006/9/26, David <[EMAIL PROTECTED]>:
> > > > Finally, I find a way to insert the string.
> > > >
> > > > In my sample;
> > > >
> > > > // insert 4 length chinese string to database
> > > > parm.Value = "测试插入";
> > > >
> > > > // and give it eight space like :
> > > > parm.Value = "测试插入";
> > > >
> > > > then all the string will insert into the database, and you will not
> > > > see the space
> > > > the string length in database is 4 as we expected.
> > > >
> > > > My conclusion is : parm.Value should be the string you want and plus
> > > > the 2*string's length space
> >
> > It _looks_ correct. I'll add some test to it as soon as I have access
> > to my linux box again (in about a week), and if all works well, commit
> > the change.
> > It would be nice to use GetBytesCount() instead, but that would
> > require knowing the exact string we are going to bind - which we don't
> > know. (Correct me if I'm wrong)
> > ___
> > Mono-devel-list mailing list
> > Mono-devel-list@lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-26 Thread David
Cound you give me a pathed OracleClient.dll,so I can test my project ?

2006/9/26, Leszek Ciesielski <[EMAIL PROTECTED]>:
> On 9/26/06, Jörg Rosenkranz <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > I have attached a patch which should fix this problem.
> > Please check that it runs correctly because I can not build and test
> > this patch here.
> >
> > Joerg.
> >
> > 2006/9/26, David <[EMAIL PROTECTED]>:
> > > Finally, I find a way to insert the string.
> > >
> > > In my sample;
> > >
> > > // insert 4 length chinese string to database
> > > parm.Value = "测试插入";
> > >
> > > // and give it eight space like :
> > > parm.Value = "测试插入";
> > >
> > > then all the string will insert into the database, and you will not
> > > see the space
> > > the string length in database is 4 as we expected.
> > >
> > > My conclusion is : parm.Value should be the string you want and plus
> > > the 2*string's length space
>
> It _looks_ correct. I'll add some test to it as soon as I have access
> to my linux box again (in about a week), and if all works well, commit
> the change.
> It would be nice to use GetBytesCount() instead, but that would
> require knowing the exact string we are going to bind - which we don't
> know. (Correct me if I'm wrong)
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-26 Thread Leszek Ciesielski
On 9/26/06, Jörg Rosenkranz <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have attached a patch which should fix this problem.
> Please check that it runs correctly because I can not build and test
> this patch here.
>
> Joerg.
>
> 2006/9/26, David <[EMAIL PROTECTED]>:
> > Finally, I find a way to insert the string.
> >
> > In my sample;
> >
> > // insert 4 length chinese string to database
> > parm.Value = "测试插入";
> >
> > // and give it eight space like :
> > parm.Value = "测试插入";
> >
> > then all the string will insert into the database, and you will not
> > see the space
> > the string length in database is 4 as we expected.
> >
> > My conclusion is : parm.Value should be the string you want and plus
> > the 2*string's length space

It _looks_ correct. I'll add some test to it as soon as I have access
to my linux box again (in about a week), and if all works well, commit
the change.
It would be nice to use GetBytesCount() instead, but that would
require knowing the exact string we are going to bind - which we don't
know. (Correct me if I'm wrong)
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-26 Thread Jörg Rosenkranz

Hi all,

I have attached a patch which should fix this problem.
Please check that it runs correctly because I can not build and test
this patch here.

Joerg.

2006/9/26, David <[EMAIL PROTECTED]>:

Finally, I find a way to insert the string.

In my sample;

// insert 4 length chinese string to database
parm.Value = "测试插入";

// and give it eight space like :
parm.Value = "测试插入";

then all the string will insert into the database, and you will not
see the space
the string length in database is 4 as we expected.

My conclusion is : parm.Value should be the string you want and plus
the 2*string's length space



OracleUTF8.patch
Description: Binary data
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-25 Thread David

Finally, I find a way to insert the string.

In my sample;

// insert 4 length chinese string to database
parm.Value = "测试插入";

// and give it eight space like :
parm.Value = "测试插入";

then all the string will insert into the database, and you will not
see the space
the string length in database is 4 as we expected.

My conclusion is : parm.Value should be the string you want and plus
the 2*string's length space
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-25 Thread Jonathan Pryor
On Mon, 2006-09-25 at 21:36 -0300, Rafael Teixeira wrote:
> Just some info, UTF-8 for Unicode 3.x, goes up to 6 bytes per character.
> 
> :|

IIRC, UTF-8 should never be 6 bytes per character.  It *can* be, to
encode the entire 31-bit address space of UCS-4, but since IIRC they
limited Unicode & ISO 10646 to be a 21-bit character set you'll
generally only see 3-byte long UTF-8 sequences as a maximum.

(They limited it to 21-bit sequences for UTF-16, as the "escape"
mechanism within UTF-16 can only support up to a 21 bit space.)

Regardless, allocating two bytes/character isn't valid.  You'd need at
least 4, assuming a UTF-8 encoding.

The "correct" value should be returned by Encoding.GetMaxByteCount().

 - Jon


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-25 Thread Rafael Teixeira
Just some info, UTF-8 for Unicode 3.x, goes up to 6 bytes per character.

:|


On 9/25/06, Jörg Rosenkranz <[EMAIL PROTECTED]> wrote:
> Hi David,
>
> 2006/9/18, David <[EMAIL PROTECTED]>:
> > ...
> > You will see the result is not we expected,not all the character insert into
> > the database.
> >
>
> I suspect the problem lies in OciDefineHandle.DefineChar. There a
> buffer of 2 * character length is allocated and filled. This is enough
> for all encodings using up to 2 bytes per character. I suspect that
> chinese UTF8 characters are longer than 2 bytes? Then the
> multiplicator at this position should be incremented. Don't know how
> to get/compute the correct value though.
>
> Joerg.
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>


-- 
Rafael "Monoman" Teixeira
---
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man." George Bernard Shaw
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-25 Thread Jörg Rosenkranz
Hi David,

2006/9/18, David <[EMAIL PROTECTED]>:
> ...
> You will see the result is not we expected,not all the character insert into
> the database.
>

I suspect the problem lies in OciDefineHandle.DefineChar. There a
buffer of 2 * character length is allocated and filled. This is enough
for all encodings using up to 2 bytes per character. I suspect that
chinese UTF8 characters are longer than 2 bytes? Then the
multiplicator at this position should be incremented. Don't know how
to get/compute the correct value though.

Joerg.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-21 Thread David

Could you please clarify this? If I get you right, you mean that the
code in the repository does not work, and mono 1.1.17.1  does not
work.

Surely the code will work if you do it as a single sql statement (if
it does not, things are FUBAR ;-) ), but it is (in regard to
performance) better to use OracleParameter. Inserting values into the
query string manualy is a workaround, but an ugly one, if you ask me.


Yes,I mean the OracleParameter bugs still exist in the newest version
of System.Data.OracleClient.dll and Mono 1.17.1.


Can you please send me both the code you use to create the table and
the c# code you have tried to execute? And information about such
things as locale settings, encoding and so on, both on your machine
and in the database?


code are:

using System;
using System.Data ;
using System.Data.OracleClient;

namespace Test{
   class MainEntry{
   public static void Main(string[] args){
   String connString = "server=video;User Id=mono;password=jcyjcy";
   String insertSql = "INSERT INTO test(name) values (:name)";
   OracleConnection conn = new OracleConnection(connString);
   try{
   conn.Open();
   OracleCommand command = new OracleCommand();
   command.Connection = conn;
   command.CommandText = insertSql;
   command.CommandType = CommandType.Text;
   OracleParameter parm = new OracleParameter(":name",
OracleType.NVarChar);
   // insert a Chinese string into table test(the
string's length is 4)
   parm.Value = "测试插入";
   command.Parameters.Add(parm);
   command.ExecuteNonQuery();
   }
   catch(Exception ex){
   Console.WriteLine(String.Format("Error is: {0}",ex.Message));
   }
   finally{
   conn.Close();
   }
   }
   }
}

create table like :
create table test (name nvarchar2(1000)

my oracle database is 10g, using utf8 for all
my linux is OpenSuSE 10.1, locate is zh_CN.UTF-8
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-21 Thread Leszek Ciesielski
On 9/21/06, David <[EMAIL PROTECTED]> wrote:
>
>
> 2006/9/19, Leszek Ciesielski <[EMAIL PROTECTED]>:
> > This has already been reported (check
> > http://bugzilla.ximian.com/show_bug.cgi?id=79004 and
> > http://bugzilla.ximian.com/show_bug.cgi?id=78840 ). Could
> you please
> > try the OracleClient from the repository? I was not able to replicate
> > the bug with the current svn code (although I am not 100% certain it
> > works correct).
> >
> >
>
> I've tried the OracleClinet from the repository.
> But it still have the problem with the current code.
>
>
Could you please clarify this? If I get you right, you mean that the
code in the repository does not work, and mono 1.1.17.1  does not
work.

Surely the code will work if you do it as a single sql statement (if
it does not, things are FUBAR ;-) ), but it is (in regard to
performance) better to use OracleParameter. Inserting values into the
query string manualy is a workaround, but an ugly one, if you ask me.
Can you please send me both the code you use to create the table and
the c# code you have tried to execute? And information about such
things as locale settings, encoding and so on, both on your machine
and in the database?
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-20 Thread David
2006/9/21, Tony Gu <[EMAIL PROTECTED]>:
David,I will argue that if OracleParametr a better solution because I dislike the Parameter personally :)  By the way, this is not only bug in the Parameter. The reality is that is not a bad workaround if you don't have the time(like me). The other options are to wait the bug fixed or you go to fixed the bug. Mono has a lot things to implement, I think.
TonyAbsolutely OracleParameter is a better way because it can be cache in the database. 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-20 Thread Tony Gu
David,I will argue that if OracleParametr a better solution because I dislike the Parameter personally :)  By the way, this is not only bug in the Parameter. The reality is that is not a bad workaround if you don't have the time(like me). The other options are to wait the bug fixed or you go to fixed the bug. Mono has a lot things to implement, I think.TonyDavid <[EMAIL PROTECTED]> wrote: 2006/9/21, Tony Gu <[EMAIL PROTECTED]>: David,Could you try to not use OracleParameter, just CommadText?I think the bug is in the Parameter decode.TonyIf not use the
 OracleParameter,the problem will not happen But not using OracleParametr is not a better solution, don't you think so?   
		How low will we go? Check out Yahoo! Messenger’s low  PC-to-Phone call rates.___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-20 Thread David
2006/9/21, Tony Gu <[EMAIL PROTECTED]>:
David,Could you try to not use OracleParameter, just CommadText?I think the bug is in the Parameter decode.TonyIf not use the OracleParameter,the problem will not happen But not using OracleParametr is not a better solution, don't you think so?

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-20 Thread David
2006/9/21, Daniel Morgan <[EMAIL PROTECTED]>:
Does your insert statement work in sqlplus?Also, does your test case work on microsoft .net?Have you used this:OracleParameter parm = new OracleParameter(":name", OracleType.NVarChar);
Which has OracleType of NVarChar instead of VarChar.And in your table you created, have it created withNVARCHAR2 instead of VARCHAR2create table test(name nvarchar2(1000));Yes, I've tested as you mentioned above, but the problem still exists
 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-20 Thread Daniel Morgan
Does your insert statement work in sqlplus?

Also, does your test case work on microsoft .net?

Have you used this:
OracleParameter parm = new OracleParameter(":name",
 OracleType.NVarChar);

Which has OracleType of NVarChar instead of VarChar.

And in your table you created, have it created with
NVARCHAR2 instead of VARCHAR2

create table test(name nvarchar2(1000));


--- David <[EMAIL PROTECTED]> wrote:

> I use System.Data.OracleClient to connect and
> operate oracle database;
> But I find a problem when inserting into oracle
> database with chinese
> character;
> Here is a simple exapmle:
> 
> using System;
> using System.Data;
> using System.Data.OracleClient;
> 
> namespace Test{
> class MainEntry{
> public static void Main(string[] args){
> String connString = "server=video;User
> Id=mono;password=jcyjcy";
> String insertSql = "INSERT INTO
> test(name) values (:name)";
> OracleConnection conn = new
> OracleConnection(connString);
> try{
> conn.Open();
> OracleCommand command = new
> OracleCommand();
> command.Connection = conn;
> command.CommandText = insertSql;
> command.CommandType =
> CommandType.Text;
> OracleParameter parm = new
> OracleParameter(":name",
> OracleType.VarChar);
> // insert a Chinese stiing into
> oracle database(the string's
> length is 4)
> parm.Value = "²âÊÔ²åÈë";
> command.Parameters.Add(parm);
> command.ExecuteNonQuery();
> }
> catch(Exception ex){
>
> Console.WriteLine(String.Format("Error is:
> {0}",ex.Message
> ));
> }
> finally{
> conn.Close();
> }
> }
> }
> }
> 
> 
> and the create table is :
> create table test(name varchar(1000));
> 
> in sqlplus :
> select * from test;
> You will see the result is not we expected,not all
> the character insert into
> the database.
> 
> Can't anybody tell me how to resolve this problem?
> > ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
>
http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-20 Thread David
2006/9/19, Leszek Ciesielski <[EMAIL PROTECTED]>:
This has already been reported (checkhttp://bugzilla.ximian.com/show_bug.cgi?id=79004 andhttp://bugzilla.ximian.com/show_bug.cgi?id=78840
 ). Could you pleasetry the OracleClient from the repository? I was not able to replicatethe bug with the current svn code (although I am not 100% certain itworks correct).I've tried the OracleClinet from the repository.
But it still have the problem with the current code.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-18 Thread Leszek Ciesielski
This has already been reported (check
http://bugzilla.ximian.com/show_bug.cgi?id=79004 and
http://bugzilla.ximian.com/show_bug.cgi?id=78840 ). Could you please
try the OracleClient from the repository? I was not able to replicate
the bug with the current svn code (although I am not 100% certain it
works correct).

On 9/18/06, David <[EMAIL PROTECTED]> wrote:
>
>
> 在06-9-18,John Anderson <[EMAIL PROTECTED] > 写道:
> > You have to have the column as NVarchar, Which is national character
> > set, It saves all data as unicode (utf8) instead of ASCII
>
>
>
> Yes, I've also tried  nvarchar2,  it also have the same problem
>  You cat try the above my code.
> my oracle database is also using utf8
> so, I think this maybe a bug


-- 
MS-DOS user since 5.0
Windows user since 3.11
Linux user since kernel 2.4
Novell Netware user since 2.2
WARCRAFT user since 1.0
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-18 Thread David
在06-9-18,John Anderson <[EMAIL PROTECTED]
> 写道:
You have to have the column as NVarchar, Which is national characterset, It saves all data as unicode (utf8) instead of ASCIIYes, I've also tried  nvarchar2,  it also have the same problem

You cat try the above my code.my oracle database is also using utf8so, I think this maybe a bug 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Maybe a System.Data.OracleClient.dll bug

2006-09-18 Thread John Anderson

You have to have the column as NVarchar, Which is national character
set, It saves all data as unicode (utf8) instead of ASCII



On 9/17/06, David <[EMAIL PROTECTED]> wrote:

I use System.Data.OracleClient to connect and operate oracle database;
But I find a problem when inserting into oracle database with chinese
character;
Here is a simple exapmle:

using System;
using System.Data ;
using System.Data.OracleClient;

namespace Test{
class MainEntry{
public static void Main(string[] args){
String connString = "server=video;User Id=mono;password=jcyjcy";
String insertSql = "INSERT INTO test(name) values (:name)";
OracleConnection conn = new OracleConnection(connString);
try{
conn.Open();
OracleCommand command = new OracleCommand();
command.Connection = conn;
command.CommandText = insertSql;
command.CommandType = CommandType.Text;
OracleParameter parm = new OracleParameter(":name",
OracleType.VarChar);
// insert a Chinese stiing into oracle database(the string's
length is 4)
parm.Value = "测试插入";
command.Parameters.Add(parm);
command.ExecuteNonQuery();
}
catch(Exception ex){
Console.WriteLine(String.Format("Error is:
{0}",ex.Message));
}
finally{
conn.Close();
}
}
}
}


and the create table is :
create table test(name varchar(1000));

in sqlplus :
select * from test;
You will see the result is not we expected,not all the character insert into
the database.

Can't anybody tell me how to resolve this problem?

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list