ODBC Using SQLDescribeCol

Go back to: Code Samples
/* Prepare dummy query */
rc = SQLPrepare (... "SELECT * FROM UnknownTable WHERE 1 = 0" ...);
 
/* Query is never executed on the server - only prepared */
rc = SQLNumResultCols (...);
for (irow = 1; irow <= NumColumns; irow++) {
    rc = SQLDescribeCol (...)
    /* + optional calls to SQLColAttributes */
    }
 
/* Result column information has now been obtained.
   Note we also know the column ordering within the table! 
   This information cannot be assumed from the 
   SQLColumns example. */




Like what you see? Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • LinkedIn
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis

Book Content Copyright © 2009 by Prentice Hall PTR. All rights reserved. | Corporate Sponsor DataDirect Technologies.