Figure 6: Sample use of miscellaneous helper functions
01 CString *name; 02 SCColumn** cols; 03 int nColumns; 04 for (int i=0;i<embsql->CatalogSize();i++) { // print catalog 05 printf("Name: %s",embsql->Catalog(i)); // of tables 06 } 07 cols = embsql->GetColumnInfo("STOCKS", &nColumns); 08 ptr = embsql->Sql("SELECT * FROM STOCKS"); 09 if (embsql->ReturnError() != "") { // print rows of the query 10 for (int i=0; i<ptr->GetSize(); i++) { // iterate over rows 11 row = (void **)ptr->GetAt(i); // get the row 12 SCTable::PrintRow(cols,nColumns,row); // print the row 13 } 14 } 15 else 16 cout << "Syntax error: " << a->ReturnError();