コード例 #1
0
ファイル: ocilib_demo.cpp プロジェクト: helloangel8002/ocilib
void test_returning(void)
{
    ocout << otext("\n>>>>> TEST RETURNING CLAUSE \n\n");

    Statement st(con);
    st.Prepare(otext("update test_lob set code = code + 1 returning code, content into :i, :l"));
    st.Register<int>(otext(":i"));
    st.Register<Clob>(otext(":l"));
    st.ExecutePrepared();

    Resultset rs = st.GetResultset();
    while (rs++)
    {
        Clob clob = rs.Get<Clob>(2);
        clob.Append(otext("(modified)"));
        clob.Seek(SeekSet, 0);

        ocout << otext("> code : ") << rs.Get<int>(1) << otext(" - ") << clob.Read(static_cast<unsigned int>(clob.GetLength())) << oendl;
    }

    con.Commit();

    ocout << oendl << rs.GetCount() << otext(" row(s) fetched") << oendl;
}