Re: ORA-24813: cannot send or receive an unsupported LOB
От: Wasilij  
Дата: 23.05.11 10:03
Оценка:
Здравствуйте, Wasilij, Вы писали:

W>Пишу на OCCI/OCI.

W>Хочу передать CLOB в PL/SQL процедуру:
W>Как сделать временный клоб на OCCI не нашел....

Нашел как сделать временный клоб на OCCI:

bool CreateTempClob(Connection* pConn, Clob& c)
{
    bool result = false;
    Statement* stmt = 0;
    try
    {
        stmt = pConn->createStatement("begin dbms_lob.createtemporary(:p1, FALSE);end;");
        stmt->registerOutParam(1, OCCICLOB);
        stmt->executeUpdate();
        c = stmt->getClob(1);
        result = true;
    }
    catch(SQLException &e)
    {
        std::stringstream ss;
        ss << "CreateTempClob FAILED 1: errorCode=" << e.getErrorCode() << ", errorText=" << e.getMessage();
        std::cout << ss.str() << std::endl;
    }

    try
    {
        if(stmt != 0)
        {
            pConn->terminateStatement(stmt);
        }
    }
    catch(SQLException &e)
    {
        result = false;
        std::stringstream ss;
        ss << "CreateTempClob FAILED 2: errorCode=" << e.getErrorCode() << ", errorText=" << e.getMessage();
        std::cout << ss.str() << std::endl;
    }
    
    return result;
}
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.