We are migrating from existing database(rdm, (http://www.raima.com/)) to SQL Server 2008 and want to use odbc feature as the existing code is written using it. We are using C as the programming language.
The existing database(RDM) provides low level API's to query to the database like select, insert ,update, delete etc. Does SQL Server 2008 provides such a feature where we can use low level API's ( and not SQL Statements like "Select * from table") to query to the database.
Let we substantiate this with an example ,
following example shows querying a column in SQL Server 2008 using ODBC
Code:
retcode = SQLExecDirect(hstmt1, (UCHAR*)"SELECT AGE FROM AdventureWorks.dbo.emp3", SQL_NTS);
while (SQL_SUCCESS == SQLFetch(hstmt1))
{
if ( (retcode = SQLGetData(hstmt1, 1, SQL_C_LONG, &Data, 0, &cbTxtSize)) != SQL_NO_DATA) {
printf("GetData iteration %d, pcbValue = %d,\n", cntr++, cbTxtSize);
printf("Data = %d\n\n", Data);
}
same example in rdm(Existing Database):
Code:
// loop from first record, till all records are traversed
for (stat = d_recfrst(emp3, HANDLETOTHEDATABSE); stat == S_OKAY; stat = d_recnext( HANDLETOTHEDATABSE) ) {
//read AGE column from table and store the result in returnValue param
d_crread(AGE, &returnValue, HANDLETOTHEDATABSE);
//do something
}
In SQL Server 2008, we are using the statement "SELECT AGE FROM AdventureWorks.dbo.emp3" to query the database. Is there any low level api's using which we can query the database like d_crread in Our existing RDM Database.