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

📄 oracle_plsql_return.cpp

📁 SQLAPI C/C++ 连接Oracle 数据库!
💻 CPP
字号:
void Oracle_PLSQL_Return(){	SAConnection con;	SACommand cmd;	cmd.setConnection(&con);	SAString sBlock = "begin  :omessage := 'my string'; end;";	cmd.setCommandText(sBlock);	try	{		con.Connect(			"test", "scott", "tiger", SA_Oracle_Client);		cmd.DestroyParams();		cmd.CreateParam("omessage", SA_dtString, -1, 20, -1, -1, SA_ParamInputOutput);		cmd.Execute();		printf("%s\n", (const SAChar*)cmd.Param("omessage").asString());	}    catch(SAException &x)    {        // SAConnection::Rollback()        // can also throw an exception        // (if a network error for example),        // we will be ready        try        {            // on error rollback changes            con.Rollback();        }        catch(SAException &)        {        }        // print error message        cout << (const char*)x.ErrText() << endl;    }}

⌨️ 快捷键说明

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