Cofeeeeeee

int main() {
otl_connect db;
otl_connect::otl_initialize();
db.rlogon("whatever");

int cuarentaydos;
const char *sql = "select 42 drom dual";
otl_stream stmt(1, sql, db);

if (!stmt.eof()) stmt >> cuarentaydos;
std::cout << "En la base 42 == " << cuarentaydos << "n";

db.logoff();
}

I spent half an hour looking for the error. How come drom is not a standard sql keyword? Damn!

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s