Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 5th, 2008, 06:58 AM
abhijitbanerjee abhijitbanerjee is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 1 abhijitbanerjee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 52 sec
Reputation Power: 0
SQL Server 2008 -> 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 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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > SQL Server 2008 -> Low level Api's


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT