Database Query

K

Keith Thompson

krish said:
Can anybody tell me how SQL query can be done using C

Yes, but not here. You'll need to ask in a newsgroup that deals with
databases. There's a comp.database.* hierarchy; quite possibly some
group there has an FAQ that answers your question.
 
D

dcorbit

krish said:
Can anybody tell me how SQL query can be done using C

Usually, it is done by one of the following methods:

1. A database specific API call
2. A standards based API call (such as ODBC, OLEDB, etc.)
3. Embedded SQL.

How to accomplish #1 will depend on your database. Often, you will
have more than one choice, even here. For instance, with PostgreSQL,
you might use LIBPQ:
http://www.postgresql.org/files/documentation/books/aw_pgsql/node147.html

How to accomplish #2 will depend on what methods and drivers you
choose.
With PostgreSQL, you might use:
http://pgfoundry.org/projects/psqlodbc/
for ODBC (among many ODBC driver possibilities)
or you might use:
http://pgfoundry.org/projects/oledb/
among many OLEDB possibilities,
etc.

How to accomplish #3 will depend on what sort of support your database
vendor offers.
For instance, ECPG is the PostgreSQL embedded SQL processor.

Note that none of this has anything to do with the C language, per se.
Probably, a group that targets your exact database system is more
appropriate. If you want to generically attach to arbitrary database
systems, then you definitely want to use a standards based approach
like ODBC or OLEDB.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top