SQL server low level API's

  • 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 me substantiate this with an example ,

     

    following example shows quering a column in SQL Server 2008

     

     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,", cntr++, cbTxtSize);

       printf("Data = %d", Data);

    }

     

     

    same example in rdm(Existing Database):

     

    // 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

    }

     

    Here 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 in SQL Server 2008.

  • Your existing ODBC should still work with very few changes (interoperability was ODBC's goal). Have you tried it?

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply