[odb-users] Executing native selects for no mapped type

Roland Kloeters roland.kloeters at xcom.de
Tue Aug 16 11:11:16 EDT 2011


Hello,

I am new to ODB and I am surprised how nice and easy it is to use it.

But now I am close to some limitations.

I have an entity defined in my db which has a primary key and gets its
value from the designated sequence. So far so good.

Now I have a second value that is some sort of sequence number declaring
an order of how these values have been inserted in the db. But that
sequence is not always the same for each row of that entity.

As I cannot set the value by default using #pragma db id auto I have to
select the value from the sequence directly.

I am using postgresql as RDMS so my select would be: "select
nextval('sequence')".

But how can I get the result of that select?

Using odb::database::execute just gives me the number of rows that have
been affected. In that case: always 1

So my question is:

Is there any chance of executing native select statements and retrieving
the results?

Kind regards
Roland






*** XCOM AG Legal Disclaimer ***

Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist
allein für den Gebrauch durch den vorgesehenen Empfaenger bestimmt.
Dritten ist das Lesen, Verteilen oder Weiterleiten dieser E-Mail
untersagt. Wir bitten, eine fehlgeleitete E-Mail unverzueglich
vollstaendig zu loeschen und uns eine Nachricht zukommen zu lassen.

This email may contain material that is confidential and for the sole
use of the intended recipient. Any review, distribution by others or
forwarding without express permission is strictly prohibited. If you are
not the intended recipient, please contact the sender and delete all
copies.

Hauptsitz: Bahnstrasse 37, D-47877 Willich, USt-IdNr.: DE 812 885 664
Kommunikation: Telefon +49 2154 9209-70, Telefax +49 2154 9209-900,
www.xcom.de
Handelsregister: Amtsgericht Krefeld, HRB 10340
Vorstand: Matthias Albrecht, Dirk Franzmeyer, Dr. Rainer Fuchs, Marco
Marty, Dirk Werner
Vorsitzender des Aufsichtsrates: Stefan H. Tarach




More information about the odb-users mailing list