31.07.2015 Views

RDM 11.0 Technical Overview Whitepaper - Raima

RDM 11.0 Technical Overview Whitepaper - Raima

RDM 11.0 Technical Overview Whitepaper - Raima

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

TECHNICAL WHITEPAPERFigure 3: Allocate HandlesFrom left to right, Figure 3 goes through the following steps:Allocate a Connection Handle (SQL_HANDLE_DBC).Set the location for storage of the database (SQL_ATTR_<strong>RDM</strong>_TFSINIT_DOCROOT). This example showshow to specify the “LabVIEW Data” directory. If this is not specified, the current directory of the executingprogram will be used.Connect.Allocate a Statement Handle (SQL_HANDLE_STMT). One connection can support many statements, but itis typical to use one.2.2 Create or Open a DatabaseCreating a database in ODBC can be accomplished by executing a minimum of two SQL statements. In the followingfigure, two Execute SQL Statement Now (SQLExecDirect) functions are used to do just that:Figure 4: Create a New DatabaseHere is a description of the steps:Execute “create database” statement. Database named HelloWorld.Execute “create table” statement. Table is named HelloTable containing one character string column namedhello.Commit the transaction. It is during the commit where the database is physically created on the storagemedia.P a g e | 4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!