How do i select all entries in a table

Forum for posting problems using QxOrm library

How do i select all entries in a table

Postby JOJO » Mon Jun 20, 2016 3:58 pm

Hello!

I have no idea how to use the search function. I tryed 5 or 6 times, but it dont let me search.

So i ask my question in the forum.

How do i select all entries in a table like: select * from comment?

I tryed it by using the fetch_all function, but i get always a [QxOrm] qx::QxSqlDatabase : 'parameters are not valid' error.

I tried it by:
Code: Select all
std::list<comment> comment_ = std::list<comment>()
qx::dao::fetch_all<comment>(comment_ );


and by:

Code: Select all
comment comment_ = comment();
qx::dao::fetch_all<comment>(comment_ );


Can anyone tell me what i am doing wrong here?
JOJO
 
Posts: 7
Joined: Mon Jun 13, 2016 8:40 am

Re: How do i select all entries in a table

Postby qxorm » Mon Jun 20, 2016 7:41 pm

Hello,

[QxOrm] qx::QxSqlDatabase : 'parameters are not valid'

This error means that you didn't define the connection settings to your database.
You should read the QxOrm manual here : http://www.qxorm.com/qxorm_en/manual.html#manual_310

Then, to get all entries, you can write :
Code: Select all
std::list<comment> comment_;
qx::dao::fetch_all(comment_);
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: How do i select all entries in a table

Postby JOJO » Mon Jun 20, 2016 8:02 pm

Oh my god.... My fault! I did not see that. Thank you very much! Sometimes its better to go to the beginning and go forward step by step.
JOJO
 
Posts: 7
Joined: Mon Jun 13, 2016 8:40 am

Re: How do i select all entries in a table

Postby qxorm » Tue Jun 21, 2016 10:23 am

Thank you very much!

you're welcome :)
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 10 guests

cron