Re: [dabo-users] Problem with custom sql-statement and getDataSet() with version>0.9.3

Author: Max Voß

Posted: 2013-04-30 at 10:51:02

>

> pk = self.Form.getBizobj("rechnung").getPK()

> sql = """SELECT rechnung_position.name, preis, anzahl

> FROM rechnung

> INNER JOIN rechnung_position ON rechnung.id=rechnung_id

> WHERE rechnung.id=%s

> ORDER BY position"""

> tmpCursor.execute(sql, (pk, ))

>

> See if that works better for you.

>

First thank you for your super fast answer, unfortunately that didn't change anything!

Still the same error when I call:

ds_artikel = tmpCursor.getDataSet()

Could there be a problem with my table-layout or its interpretation of dabo?

Here the SQL-Snippet of the table:

CREATE TABLE IF NOT EXISTS `rechnung_position` (

`id` int(11) NOT NULL AUTO_INCREMENT,

`rechnung_id` int(11) NOT NULL,

`name` varchar(300) NOT NULL,

`preis` float NOT NULL,

`anzahl` int(11) NOT NULL,

`position` int(11) NOT NULL,

PRIMARY KEY (`id`),

KEY `rchnung_id` (`rechnung_id`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1665 ;

--

-- Daten für Tabelle `rechnung_position`

--

INSERT INTO `rechnung_position` (`id`, `rechnung_id`, `name`, `preis`, `anzahl`, `position`) VALUES

(9, 1, 'Fassung', 130, 1, 0),

(2, 0, 'test2', 0, 2, 0),

(10, 2, 'Spray', 3, 1, 0),

(8, 1, 'Gläser', 79, 2, 0),

...

_______________________________________________

Post Messages to: Dabo-users@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users

Searchable Archives: http://leafe.com/archives/search/dabo-users

This message: http://leafe.com/archives/byMID/1367337062.5128.36.camel@max

©2013 Max Voß