Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Cannot use decimal or numeric types with ADO.NET

11 posts in General Discussion Last posting was on 2009-09-10 19:03:02.0Z
CozyRoc Posted on 2009-08-31 18:48:53.0Z
Sender: 7c99.4a9bc1c5.1804289383@sybase.com
From: CozyRoc
Newsgroups: sybase.public.ase.general
Subject: Cannot use decimal or numeric types with ADO.NET
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a9c1b15.b9c.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 31 Aug 2009 11:48:53 -0700
X-Trace: forums-1-dub 1251744533 10.22.241.41 (31 Aug 2009 11:48:53 -0700)
X-Original-Trace: 31 Aug 2009 11:48:53 -0700, 10.22.241.41
Lines: 14
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28237
Article PK: 77481

Hello Guys,

I'm trying to insert data in ASE database using ADO.NET and
OdbcConnection / OdbcParameter in particular. It works fine
with integer, double, date time and strings but when I try
to insert column of type decimal it fails with this message:

"ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
Enterprise]Implicit conversion from datatype 'CHAR' to
'NUMERIC' is not allowed. Use the CONVERT function to run
this query. "

Have you seen this issue before? I have already successfully
tested this code with other databases and it works fine.


Sherlock, Kevin [TeamSybase] Posted on 2009-08-31 19:05:18.0Z
From: "Sherlock, Kevin [TeamSybase]" <kevin.sherlock@teamsybase.com>
Newsgroups: sybase.public.ase.general
References: <4a9c1b15.b9c.1681692777@sybase.com>
Subject: Re: Cannot use decimal or numeric types with ADO.NET
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a9c1eee$1@forums-1-dub>
Date: 31 Aug 2009 12:05:18 -0700
X-Trace: forums-1-dub 1251745518 10.22.241.152 (31 Aug 2009 12:05:18 -0700)
X-Original-Trace: 31 Aug 2009 12:05:18 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28238
Article PK: 77482

probably a good question for the sybase.public.connectivity.adonet
newsgroup.

<CozyRoc> wrote in message news:4a9c1b15.b9c.1681692777@sybase.com...
> Hello Guys,
>
> I'm trying to insert data in ASE database using ADO.NET and
> OdbcConnection / OdbcParameter in particular. It works fine
> with integer, double, date time and strings but when I try
> to insert column of type decimal it fails with this message:
>
> "ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
> Enterprise]Implicit conversion from datatype 'CHAR' to
> 'NUMERIC' is not allowed. Use the CONVERT function to run
> this query. "
>
> Have you seen this issue before? I have already successfully
> tested this code with other databases and it works fine.


J Posted on 2009-08-31 22:05:13.0Z
From: jtotally_bogus@sbcglobal.net (J)
Newsgroups: sybase.public.ase.general
Subject: Re: Cannot use decimal or numeric types with ADO.NET
Reply-To: J@bogusemailAddress.com
Message-ID: <4a9c4896.21978813@forums.sybase.com>
References: <4a9c1b15.b9c.1681692777@sybase.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 31 Aug 2009 15:05:13 -0700
X-Trace: forums-1-dub 1251756313 10.22.241.152 (31 Aug 2009 15:05:13 -0700)
X-Original-Trace: 31 Aug 2009 15:05:13 -0700, vip152.sybase.com
Lines: 36
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28242
Article PK: 77485

On 31 Aug 2009 11:48:53 -0700, CozyRoc wrote:

Use some sort of a trace of the sql like Ribo to see what your sql is
in this case. Other DBMS may implicitly do a conversion from 'char'
to 'numberic' type for you but ASE is not.

Look at this:

1> create table t (c1 numeric(9,0))
2> go
1> insert into t values ('1234')
2> go
Msg 257, Level 16, State 1:
Server 'jaylinux_1502', Line 1:
Implicit conversion from datatype 'VARCHAR' to 'NUMERIC' is not
allowed. Use
the CONVERT function to run this query.
1> insert into t values (convert(numeric(9,0), '1234'))
2> go
(1 row affected)

>Hello Guys,
>
>I'm trying to insert data in ASE database using ADO.NET and
>OdbcConnection / OdbcParameter in particular. It works fine
>with integer, double, date time and strings but when I try
>to insert column of type decimal it fails with this message:
>
>"ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
>Enterprise]Implicit conversion from datatype 'CHAR' to
>'NUMERIC' is not allowed. Use the CONVERT function to run
>this query. "
>
>Have you seen this issue before? I have already successfully
>tested this code with other databases and it works fine.


CozyRoc Posted on 2009-09-01 03:45:26.0Z
Sender: 1b8a.4a9c970c.1804289383@sybase.com
From: CozyRoc
Newsgroups: sybase.public.ase.general
Subject: Re: Cannot use decimal or numeric types with ADO.NET
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a9c98d6.1bab.1681692777@sybase.com>
References: <4a9c4896.21978813@forums.sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 31 Aug 2009 20:45:26 -0700
X-Trace: forums-1-dub 1251776726 10.22.241.41 (31 Aug 2009 20:45:26 -0700)
X-Original-Trace: 31 Aug 2009 20:45:26 -0700, 10.22.241.41
Lines: 48
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28246
Article PK: 77490

J,

This same code has been already successfully tested with SQL
Server, Oracle, DB2, MySQL, Informix, PostgreSQL. If there
is incompatibility issue it is between the ADO.NET stack and
the Sybase ODBC support. Check my comment to Paul. It does
include a link to a bug case with the C# code reproducing
the problem. You should be able to see the problem
immediately.

> On 31 Aug 2009 11:48:53 -0700, CozyRoc wrote:
>
> Use some sort of a trace of the sql like Ribo to see what
> your sql is in this case. Other DBMS may implicitly do a
> conversion from 'char' to 'numberic' type for you but ASE
> is not.
>
> Look at this:
>
> 1> create table t (c1 numeric(9,0))
> 2> go
> 1> insert into t values ('1234')
> 2> go
> Msg 257, Level 16, State 1:
> Server 'jaylinux_1502', Line 1:
> Implicit conversion from datatype 'VARCHAR' to 'NUMERIC'
> is not allowed. Use
> the CONVERT function to run this query.
> 1> insert into t values (convert(numeric(9,0), '1234'))
> 2> go
> (1 row affected)
>
> >Hello Guys,
> >
> >I'm trying to insert data in ASE database using ADO.NET
> and >OdbcConnection / OdbcParameter in particular. It
> works fine >with integer, double, date time and strings
> but when I try >to insert column of type decimal it fails
> with this message: >
> >"ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
> >Enterprise]Implicit conversion from datatype 'CHAR' to
> >'NUMERIC' is not allowed. Use the CONVERT function to
> run >this query. "
> >
> >Have you seen this issue before? I have already
> successfully >tested this code with other databases and it
> works fine.
>


Paul Vero [Sybase] Posted on 2009-08-31 23:10:19.0Z
From: "Paul Vero [Sybase]" <pvero@nospam.com>
Newsgroups: sybase.public.ase.general
References: <4a9c1b15.b9c.1681692777@sybase.com>
Subject: Re: Cannot use decimal or numeric types with ADO.NET
Lines: 27
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3598
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a9c585b$1@forums-1-dub>
Date: 31 Aug 2009 16:10:19 -0700
X-Trace: forums-1-dub 1251760219 10.22.241.152 (31 Aug 2009 16:10:19 -0700)
X-Original-Trace: 31 Aug 2009 16:10:19 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28244
Article PK: 77488

Hi

How are you inserting? Using a parameter or are you trying to pass a
literal
string value for the numeric item? Could you post some of the code here?

-Paul

<CozyRoc> wrote in message news:4a9c1b15.b9c.1681692777@sybase.com...
> Hello Guys,
>
> I'm trying to insert data in ASE database using ADO.NET and
> OdbcConnection / OdbcParameter in particular. It works fine
> with integer, double, date time and strings but when I try
> to insert column of type decimal it fails with this message:
>
> "ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
> Enterprise]Implicit conversion from datatype 'CHAR' to
> 'NUMERIC' is not allowed. Use the CONVERT function to run
> this query. "
>
> Have you seen this issue before? I have already successfully
> tested this code with other databases and it works fine.


CozyRoc Posted on 2009-09-01 03:40:25.0Z
Sender: 1b8a.4a9c970c.1804289383@sybase.com
From: CozyRoc
Newsgroups: sybase.public.ase.general
Subject: Re: Cannot use decimal or numeric types with ADO.NET
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a9c97a9.1b94.1681692777@sybase.com>
References: <4a9c585b$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 31 Aug 2009 20:40:25 -0700
X-Trace: forums-1-dub 1251776425 10.22.241.41 (31 Aug 2009 20:40:25 -0700)
X-Original-Trace: 31 Aug 2009 20:40:25 -0700, 10.22.241.41
Lines: 36
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28245
Article PK: 77489

Paul,

I have created a bug case report, which includes also code.
You can check it here:

http://case-express.sybase.com/cx/caseSheet.do?caseNumber=11553757

> Hi
>
> How are you inserting? Using a parameter or are you
> trying to pass a literal
> string value for the numeric item? Could you post some of
> the code here?
>
> -Paul
>
>
>
> <CozyRoc> wrote in message
> > news:4a9c1b15.b9c.1681692777@sybase.com... Hello Guys,
> >
> > I'm trying to insert data in ASE database using ADO.NET
> > and OdbcConnection / OdbcParameter in particular. It
> > works fine with integer, double, date time and strings
> > but when I try to insert column of type decimal it fails
> with this message: >
> > "ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
> > Enterprise]Implicit conversion from datatype 'CHAR' to
> > 'NUMERIC' is not allowed. Use the CONVERT function to
> > run this query. "
> >
> > Have you seen this issue before? I have already
> > successfully tested this code with other databases and
> it works fine.
>
>


Paul Vero [Sybase] Posted on 2009-09-01 14:44:48.0Z
From: "Paul Vero [Sybase]" <pvero@nospam.com>
Newsgroups: sybase.public.ase.general
References: <4a9c585b$1@forums-1-dub> <4a9c97a9.1b94.1681692777@sybase.com>
Subject: Re: Cannot use decimal or numeric types with ADO.NET
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3598
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a9d3360$1@forums-1-dub>
Date: 1 Sep 2009 07:44:48 -0700
X-Trace: forums-1-dub 1251816288 10.22.241.152 (1 Sep 2009 07:44:48 -0700)
X-Original-Trace: 1 Sep 2009 07:44:48 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28254
Article PK: 77497

Hi,

Interesting - someone should start working that case and it'll probably go
to me.
It looks like it should work. I vaguely recall something similar to using
the ADO.NET
Provider.

What version of the ODBC Driver is this?

-Paul

<CozyRoc> wrote in message news:4a9c97a9.1b94.1681692777@sybase.com...
> Paul,
>
> I have created a bug case report, which includes also code.
> You can check it here:
>
> http://case-express.sybase.com/cx/caseSheet.do?caseNumber=11553757
>
>> Hi
>>
>> How are you inserting? Using a parameter or are you
>> trying to pass a literal
>> string value for the numeric item? Could you post some of
>> the code here?
>>
>> -Paul
>>
>>
>>
>> <CozyRoc> wrote in message
>> > news:4a9c1b15.b9c.1681692777@sybase.com... Hello Guys,
>> >
>> > I'm trying to insert data in ASE database using ADO.NET
>> > and OdbcConnection / OdbcParameter in particular. It
>> > works fine with integer, double, date time and strings
>> > but when I try to insert column of type decimal it fails
>> with this message: >
>> > "ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
>> > Enterprise]Implicit conversion from datatype 'CHAR' to
>> > 'NUMERIC' is not allowed. Use the CONVERT function to
>> > run this query. "
>> >
>> > Have you seen this issue before? I have already
>> > successfully tested this code with other databases and
>> it works fine.
>>
>>


CozyRoc Posted on 2009-09-01 18:28:37.0Z
Sender: 1bc4.4a9c99f5.1804289383@sybase.com
From: CozyRoc
Newsgroups: sybase.public.ase.general
Subject: Re: Cannot use decimal or numeric types with ADO.NET
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a9d67d5.33fd.1681692777@sybase.com>
References: <4a9d3360$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 1 Sep 2009 11:28:37 -0700
X-Trace: forums-1-dub 1251829717 10.22.241.41 (1 Sep 2009 11:28:37 -0700)
X-Original-Trace: 1 Sep 2009 11:28:37 -0700, 10.22.241.41
Lines: 62
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28258
Article PK: 77502

Paul,

The driver version is: 15.0.0.325

p.s.

I have filed 2 more issues related to the ODBC driver. You
can check the cases: 11553885, 11553762

> Hi,
>
> Interesting - someone should start working that case and
> it'll probably go to me.
> It looks like it should work. I vaguely recall something
> similar to using the ADO.NET
> Provider.
>
> What version of the ODBC Driver is this?
>
> -Paul
>
> <CozyRoc> wrote in message
> > news:4a9c97a9.1b94.1681692777@sybase.com... Paul,
> >
> > I have created a bug case report, which includes also
> > code. You can check it here:
> >
> >
>
http://case-express.sybase.com/cx/caseSheet.do?caseNumber=11553757
> >
> >> Hi
> >>
> >> How are you inserting? Using a parameter or are you
> >> trying to pass a literal
> >> string value for the numeric item? Could you post some
> of >> the code here?
> >>
> >> -Paul
> >>
> >>
> >>
> >> <CozyRoc> wrote in message
> >> > news:4a9c1b15.b9c.1681692777@sybase.com... Hello Guys
> , >> >
> >> > I'm trying to insert data in ASE database using
> ADO.NET >> > and OdbcConnection / OdbcParameter in
> particular. It >> > works fine with integer, double, date
> time and strings >> > but when I try to insert column of
> type decimal it fails >> with this message: >
> >> > "ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
> >> > Enterprise]Implicit conversion from datatype 'CHAR'
> to >> > 'NUMERIC' is not allowed. Use the CONVERT
> function to >> > run this query. "
> >> >
> >> > Have you seen this issue before? I have already
> >> > successfully tested this code with other databases
> and >> it works fine.
> >>
> >>
>
>


Paul Vero [Sybase] Posted on 2009-09-03 19:12:59.0Z
From: "Paul Vero [Sybase]" <pvero@nospam.com>
Newsgroups: sybase.public.ase.general
References: <4a9d3360$1@forums-1-dub> <4a9d67d5.33fd.1681692777@sybase.com>
Subject: Re: Cannot use decimal or numeric types with ADO.NET
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3598
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4aa0153b$1@forums-1-dub>
Date: 3 Sep 2009 12:12:59 -0700
X-Trace: forums-1-dub 1252005179 10.22.241.152 (3 Sep 2009 12:12:59 -0700)
X-Original-Trace: 3 Sep 2009 12:12:59 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28270
Article PK: 77513

Hi

Could you try 15.0.0.353, from SDK 15.0 ESD#19?

Also, what happens if you try

OdbcParameter param = new OdbcParameter( "COL1", OdbcType.Decimal, 0 );

And - you have param.Value =

What are you passing for the actual values?

If you're not hearing from Tech Support on your open cases please call
1-800-879-2273 (1-800-8SYBASE)

Thank you,

-Paul

<CozyRoc> wrote in message news:4a9d67d5.33fd.1681692777@sybase.com...
> Paul,
>
> The driver version is: 15.0.0.325
>
> p.s.
>
> I have filed 2 more issues related to the ODBC driver. You
> can check the cases: 11553885, 11553762
>
>> Hi,
>>
>> Interesting - someone should start working that case and
>> it'll probably go to me.
>> It looks like it should work. I vaguely recall something
>> similar to using the ADO.NET
>> Provider.
>>
>> What version of the ODBC Driver is this?
>>
>> -Paul
>>
>> <CozyRoc> wrote in message
>> > news:4a9c97a9.1b94.1681692777@sybase.com... Paul,
>> >
>> > I have created a bug case report, which includes also
>> > code. You can check it here:
>> >
>> >
>>
> http://case-express.sybase.com/cx/caseSheet.do?caseNumber=11553757
>> >
>> >> Hi
>> >>
>> >> How are you inserting? Using a parameter or are you
>> >> trying to pass a literal
>> >> string value for the numeric item? Could you post some
>> of >> the code here?
>> >>
>> >> -Paul
>> >>
>> >>
>> >>
>> >> <CozyRoc> wrote in message
>> >> > news:4a9c1b15.b9c.1681692777@sybase.com... Hello Guys
>> , >> >
>> >> > I'm trying to insert data in ASE database using
>> ADO.NET >> > and OdbcConnection / OdbcParameter in
>> particular. It >> > works fine with integer, double, date
>> time and strings >> > but when I try to insert column of
>> type decimal it fails >> with this message: >
>> >> > "ERROR [42000] [Sybase][ODBC Driver][Adaptive Server
>> >> > Enterprise]Implicit conversion from datatype 'CHAR'
>> to >> > 'NUMERIC' is not allowed. Use the CONVERT
>> function to >> > run this query. "
>> >> >
>> >> > Have you seen this issue before? I have already
>> >> > successfully tested this code with other databases
>> and >> it works fine.
>> >>
>> >>
>>
>>


CozyRoc Posted on 2009-09-04 03:45:45.0Z
Sender: 1d39.4aa084da.1804289383@sybase.com
From: CozyRoc
Newsgroups: sybase.public.ase.general
Subject: Re: Cannot use decimal or numeric types with ADO.NET
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4aa08d68.1dff.1681692777@sybase.com>
References: <4aa0153b$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 3 Sep 2009 20:45:45 -0700
X-Trace: forums-1-dub 1252035945 10.22.241.41 (3 Sep 2009 20:45:45 -0700)
X-Original-Trace: 3 Sep 2009 20:45:45 -0700, 10.22.241.41
Lines: 103
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28271
Article PK: 77514

Paul,

From where can I download the latest release? I have used
the publicly available installation of ASE 15, which is not
very recent.

Also regarding the CR, I'm sorry I must have missed the
parameter. The code should say this:

param.Value = new decimal( 1 );

p.s.
I don't think the Tech Support will assist me too much
because I'm not a Sybase customer. We are just an ISV trying
to provide additional solutions for Sybase customers.

> Hi
>
> Could you try 15.0.0.353, from SDK 15.0 ESD#19?
>
> Also, what happens if you try
>
> OdbcParameter param = new OdbcParameter( "COL1",
> OdbcType.Decimal, 0 );
>
> And - you have param.Value =
>
> What are you passing for the actual values?
>
> If you're not hearing from Tech Support on your open cases
> please call 1-800-879-2273 (1-800-8SYBASE)
>
> Thank you,
>
> -Paul
>
> <CozyRoc> wrote in message
> > news:4a9d67d5.33fd.1681692777@sybase.com... Paul,
> >
> > The driver version is: 15.0.0.325
> >
> > p.s.
> >
> > I have filed 2 more issues related to the ODBC driver.
> > You can check the cases: 11553885, 11553762
> >
> >> Hi,
> >>
> >> Interesting - someone should start working that case
> and >> it'll probably go to me.
> >> It looks like it should work. I vaguely recall
> something >> similar to using the ADO.NET
> >> Provider.
> >>
> >> What version of the ODBC Driver is this?
> >>
> >> -Paul
> >>
> >> <CozyRoc> wrote in message
> >> > news:4a9c97a9.1b94.1681692777@sybase.com... Paul,
> >> >
> >> > I have created a bug case report, which includes also
> >> > code. You can check it here:
> >> >
> >> >
> >>
> >
>
http://case-express.sybase.com/cx/caseSheet.do?caseNumber=11553757
> >> >
> >> >> Hi
> >> >>
> >> >> How are you inserting? Using a parameter or are you
> >> >> trying to pass a literal
> >> >> string value for the numeric item? Could you post
> some >> of >> the code here?
> >> >>
> >> >> -Paul
> >> >>
> >> >>
> >> >>
> >> >> <CozyRoc> wrote in message
> >> >> > news:4a9c1b15.b9c.1681692777@sybase.com... Hello
> Guys >> , >> >
> >> >> > I'm trying to insert data in ASE database using
> >> ADO.NET >> > and OdbcConnection / OdbcParameter in
> >> particular. It >> > works fine with integer, double,
> date >> time and strings >> > but when I try to insert
> column of >> type decimal it fails >> with this message: >
> >> >> > "ERROR [42000] [Sybase][ODBC Driver][Adaptive
> Server >> >> > Enterprise]Implicit conversion from
> datatype 'CHAR' >> to >> > 'NUMERIC' is not allowed. Use
> the CONVERT >> function to >> > run this query. "
> >> >> >
> >> >> > Have you seen this issue before? I have already
> >> >> > successfully tested this code with other databases
> >> and >> it works fine.
> >> >>
> >> >>
> >>
> >>
>
>


Paul Vero [Sybase] Posted on 2009-09-10 19:03:02.0Z
From: "Paul Vero [Sybase]" <pvero@nospam.com>
Newsgroups: sybase.public.ase.general
References: <4aa0153b$1@forums-1-dub> <4aa08d68.1dff.1681692777@sybase.com>
Subject: Re: Cannot use decimal or numeric types with ADO.NET
Lines: 127
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3598
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4aa94d66$1@forums-1-dub>
Date: 10 Sep 2009 12:03:02 -0700
X-Trace: forums-1-dub 1252609382 10.22.241.152 (10 Sep 2009 12:03:02 -0700)
X-Original-Trace: 10 Sep 2009 12:03:02 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:28296
Article PK: 77540

Hi CozyRoc,

You need the ASE license or SDK license to get latest releases.

I checked this code and I get the same error.

The weird thing is the ODBC Layer (the .net) checks to see what a Numeric
value can convert to - odbc type, and the response is nothing - meaning you
need to bind as Numeric. But in odbc trace, the layer is forcing the bind to
character types and ASE won't allow this. I tried with Sybase and the older
OEM version and same thing happens. With MSSQL Server the convert says
nothing use Numeric and the layer binds to Numeric! I don't see why this is
happening - the driver clearly states to the layer no conversion is allowed
and yet the .NET layer binds to SQL_C_CHAR. I tried using OdbcType.Decimal
and the same thing occurred.

I am not sure how to get around this. The Driver doesn't control the
binding.

-Paul

<CozyRoc> wrote in message news:4aa08d68.1dff.1681692777@sybase.com...
> Paul,
>
> From where can I download the latest release? I have used
> the publicly available installation of ASE 15, which is not
> very recent.
>
> Also regarding the CR, I'm sorry I must have missed the
> parameter. The code should say this:
>
> param.Value = new decimal( 1 );
>
> p.s.
> I don't think the Tech Support will assist me too much
> because I'm not a Sybase customer. We are just an ISV trying
> to provide additional solutions for Sybase customers.
>
>> Hi
>>
>> Could you try 15.0.0.353, from SDK 15.0 ESD#19?
>>
>> Also, what happens if you try
>>
>> OdbcParameter param = new OdbcParameter( "COL1",
>> OdbcType.Decimal, 0 );
>>
>> And - you have param.Value =
>>
>> What are you passing for the actual values?
>>
>> If you're not hearing from Tech Support on your open cases
>> please call 1-800-879-2273 (1-800-8SYBASE)
>>
>> Thank you,
>>
>> -Paul
>>
>> <CozyRoc> wrote in message
>> > news:4a9d67d5.33fd.1681692777@sybase.com... Paul,
>> >
>> > The driver version is: 15.0.0.325
>> >
>> > p.s.
>> >
>> > I have filed 2 more issues related to the ODBC driver.
>> > You can check the cases: 11553885, 11553762
>> >
>> >> Hi,
>> >>
>> >> Interesting - someone should start working that case
>> and >> it'll probably go to me.
>> >> It looks like it should work. I vaguely recall
>> something >> similar to using the ADO.NET
>> >> Provider.
>> >>
>> >> What version of the ODBC Driver is this?
>> >>
>> >> -Paul
>> >>
>> >> <CozyRoc> wrote in message
>> >> > news:4a9c97a9.1b94.1681692777@sybase.com... Paul,
>> >> >
>> >> > I have created a bug case report, which includes also
>> >> > code. You can check it here:
>> >> >
>> >> >
>> >>
>> >
>>
> http://case-express.sybase.com/cx/caseSheet.do?caseNumber=11553757
>> >> >
>> >> >> Hi
>> >> >>
>> >> >> How are you inserting? Using a parameter or are you
>> >> >> trying to pass a literal
>> >> >> string value for the numeric item? Could you post
>> some >> of >> the code here?
>> >> >>
>> >> >> -Paul
>> >> >>
>> >> >>
>> >> >>
>> >> >> <CozyRoc> wrote in message
>> >> >> > news:4a9c1b15.b9c.1681692777@sybase.com... Hello
>> Guys >> , >> >
>> >> >> > I'm trying to insert data in ASE database using
>> >> ADO.NET >> > and OdbcConnection / OdbcParameter in
>> >> particular. It >> > works fine with integer, double,
>> date >> time and strings >> > but when I try to insert
>> column of >> type decimal it fails >> with this message: >
>> >> >> > "ERROR [42000] [Sybase][ODBC Driver][Adaptive
>> Server >> >> > Enterprise]Implicit conversion from
>> datatype 'CHAR' >> to >> > 'NUMERIC' is not allowed. Use
>> the CONVERT >> function to >> > run this query. "
>> >> >> >
>> >> >> > Have you seen this issue before? I have already
>> >> >> > successfully tested this code with other databases
>> >> and >> it works fine.
>> >> >>
>> >> >>
>> >>
>> >>
>>
>>