Menu

#2 set_all_column_types doesn't enable string extraction

open
nobody
None
5
2003-07-17
2003-07-17
Anonymous
No

When using the set_all_column_types method on
otl_stream, the stream extraction operator raises a
"Incompatible data types in stream operation" exception
when reading in non-character columns. The attached
sample program demonstrates the problem.

Compiler: g++ v3.1.1
OS: Linux (Red Hat v7.3 running 2.4.20 kernel)
DBMS: Oracle 9i 9.0.1.1.1

Discussion

  • Nobody/Anonymous

    example of OTL conversion problem

     
  • Valery Syssik

    Valery Syssik - 2003-07-18

    Logged In: YES
    user_id=427100

    You have to set_all_column_types before open otl_stream:
    ///////////////////////////////////
    otl_stream sql;
    sql.set_all_column_types (otl_all_num2str | otl_all_date2str);
    sql.open (1, "select 12345, 'foo', sysdate from dual where :
    f<int> = 1", conn);
    ///////////////////////////////////

     
  • Nobody/Anonymous

    Logged In: NO

    You are entirely correct! Once updated, the SQL works as
    expected. Thanks for your time on this.

    Steve

     

Log in to post a comment.