PDA

View Full Version : database



sattu
22nd September 2010, 16:01
hi everyone!
I have created a database and stored upto 10,000 records in it. The fields are id,name and address. Now i want to extract the required fields and store it in the corresponding variables(id,name,address).
Well how to do it? i'm really confused. Can any one please help me?


with regards,

nish
22nd September 2010, 16:33
if u created it by SQL u can get it by SQL.. what is the problem exactly?

sattu
22nd September 2010, 16:51
if u created it by SQL u can get it by SQL.. what is the problem exactly?

no no, what i want to say is that i don't know the exact code. I mean to say, please tell me all the syntaxes for performing the extraction operation from the database. :confused:

tbscope
22nd September 2010, 16:58
Can I ask you some personal questions?
How old are you? Is this homework?

Getting information out of a sql database is very easy. There are millions, if not billions of articles on google. Let me give you one:

http://www.w3schools.com/sql/default.asp

As for using sql queries with Qt:
http://doc.qt.nokia.com/4.6/qsqlquery.html

Now, read those pages and if you still have a question, please ask.

sattu
23rd September 2010, 05:36
Can I ask you some personal questions?
How old are you? Is this homework?

Now, read those pages and if you still have a question, please ask.

Thanks tbscope for ur childish reply. But let me tell you that first of all i have no idea of sql database or sql language. I have begun directly from Qt.
Secondly, the link that you have provided: http://doc.qt.nokia.com/4.6/qsqlquery.html, i have already gone through those pages. But there i find so many functions declared but so less explanation, that i really get confused as to which one to use and which one not to. That's why I seek out help in this forum to know the basic syntaxes as Qt is completely new to me. So if you have any links where explanations are also there regarding the predefined functions, then do send me. That could really help me. Now i hope you understand my problem rather than my age.
Thanks for your concern.

Lykurg
23rd September 2010, 06:17
The solution for your problem is well described in the Detailed Description of QSqlQuery (Or have a look at the examples of the QtSql Module). What else do you need to know? Also it would be nice if you could show us what you have so far.

And the question if it is your homework was because we have the rule here, not to post solutions for homework. So you won't see any piece of code here! Also if you post some we can correct.

nish
23rd September 2010, 06:18
You need to have at least basic knowledge of SQL to use QtSql module. It is like using Qt without having knowledge of C++. But as your need is very simple, just go through the example programs provided with Qt. I m sure the examples will show u the way.

sattu
23rd September 2010, 07:30
The solution for your problem is well described in the Detailed Description of QSqlQuery (Or have a look at the examples of the QtSql Module). What else do you need to .....................t.
Well that's fine! I didn't know about that rule. Actually it's difficult to tell how much i have learnt upto now. I think the more i get used to Qt, the more i will find it understandable. So let me wait for time. If i have any doubt or error in code i could surely ask for it. But if i don't find any required syntaxes then i think i just need to keep on searching for it. O.k thanks once again.

With regards,