⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mysql_insertid.cpp

📁 SQLAPI C/C++ 连接Oracle 数据库!
💻 CPP
字号:
#include <myAPI.h>void MySQL_InsertID(){	SAConnection con; // connection object    SACommand cmd(&con, "insert into t2(f2) values('new line')");		try	{		con.Connect("test", "ODBC", "", SA_MySQL_Client);		cout << (const char*)con.ServerVersionString() << endl;		cout << (con.ClientVersion() >> 16) << "."			<< (con.ClientVersion() &0x0000FFFF) << endl;		cmd.Execute();				myAPI* p_myAPI = (myAPI*)con.NativeAPI();		myConnectionHandles* p_myConnHandles =			(myConnectionHandles*)con.NativeHandles();		cout << "new value of the auto increment field: " <<			(long)p_myAPI->mysql_insert_id(p_myConnHandles->mysql) << endl;	}    catch(SAException &x)    {        // print error message        printf("%s\n", (const char*)x.ErrText());    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -