2 messages in com.mysql.lists.dotnetRe: Problem with decimal fields in su...| Subject: | Re: Problem with decimal fields in subquery![]() |
|---|---|
| From: | Pyt (py.t...@gmail.com) |
| Date: | 07/31/2005 10:01:46 PM |
| List: | com.mysql.lists.dotnet |
I think there is a compatibility problem with the connector and some versions of MySql regarding decimal. I can't remember off hand what the problem is, but you might want to check the list archives. It's been debated already. Pyt.
On 7/31/05, Frank - stre...@tiscali.it<+mysql+pyt+cedbc63385.streamlake#tiscali.it@ spamgourmet.com <http://spamgourmet.com>> wrote:
Hi, I have this two tables:
CREATE TABLE `A` ( `cod` int(11) NOT NULL default '0', `descr` varchar(100) default NULL, `aliq` decimal(10,4) default NULL, PRIMARY KEY (`cod`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `B` ( `cod` int(11) NOT NULL default '0', `cod_a` int(11) default NULL, <-- this 'references' A.cod
... OTHER FIELDS ...
PRIMARY KEY (`cod`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I'm filling a DataSet (via a DataAdapter.Fill() call) with this statement: "SELECT B.*, (SELECT aliq FROM A WHERE cod = B.cod_a) AS aaa FROM B"
As field aliq in table A is DECIMAL I expect to receive a decimal type for aaa in my select, but I receive a casting error and looking at debugger windows in Visual Studio it shows the last Item of the DataRow as System.Double (while other decimal fields are correctly identified as decimal). Am I doing something wrong? Maybe this has something to do with the subquery...
Thanks, Frank




