A significant portion of computer programmes today work with large amounts of data. A language such as C++ can build powerful applications but cannot efficiently define database structures and is poor at generating adhoc queries. On the contrary, a language such as SQL is very good at defining structures of databases and generating adhoc queries but cannot build sophisticated database applications or any applications.
My questions are as follows:
1) I often find myself wanting to access the, say, fourth element of the 10th row of a flat table called X. In C++ I would traditionally access these elements by opening the database in a tab delimited text file and counting the new lines and tabs to reach to the desired column/row element.
I do not take pride in this method as it is too low level, cumbersome, unsophisticated and lacks the high level power to do complicated queries.
Would this concern of mine be best answered if I use an embedded database language within C++?
2) If answer one is in the positive, I would need to use Pro*C/C++, correct? If answer one is in the negative, what do all of you use when accessing rows and columns of large databases and want to perform non-basic queries? What else would you suggest apart from Pro*C/C++?
3) How would I go about implementing Pro*c/C++? It seems the documentation quotes that you need a completely separate compiler to recognize C/C++ and SQL. Why is this? Why cant they merely add a LIBRARY of SQL type functions? I guess that is impractical to use when typing in queries in the form of functions? EDIT: I see that Pro*C/C++ is a pre-compiler in which case I think I understand its benefits. But I still dont need a library? How do I make my IDE recognise the Pro*C/C++ Pre-compiler?