Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute sql statements from a C program?

How can I execute SQL statements from a C program. For example I want to display the output of

select * from EMP

from a c program. Do I need to do it using Stored Procedures? Do I need any library files to do it. My C compiler is Tiny C Compiler and I am currently having SQL server studio 2005. Suggestions for Unix/AIX platform + GCC are also invited.

Thanks in advance..

like image 466
Enjoy coding Avatar asked May 13 '26 14:05

Enjoy coding


1 Answers

The old but reliable solution, for *ix as well as Windows, and for all (significant) database servers, is ODBC. I recommend the Easysoft tutorial. According to this, you may have to manually install the SQL Server ODBC driver from CD.

like image 63
Matthew Flaschen Avatar answered May 16 '26 02:05

Matthew Flaschen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!