OTL 4.0, OTL reference cursor stream class

OTL reference cursor stream class

This class (otl_refcur_stream) is used for reading rows from a reference cursor bind variable. The class is defined for OTL/OCI8/9 only. It's similar to the otl_stream class itself, when the otl_stream is instantiated with a SELECT statement, or with a single reference cursor. otl_refcur_stream can be initiliazed by reading a reference cursor descriptor from an otl_stream. The class, in tandem with the refcur placeholder, allows the otl_stream to return multiple reference cursors from a stored procedure call in one shot.

Potentially, the otl_lob_stream class may raise an OTL defined exception.

All of the functions, defined in this class, mimick the otl_stream functions, therefore, see the descriptions of the corresponding functions in otl_stream.

class otl_refcur_stream {
public:
 void set_column_type(const int column_ndx,
                      const int col_type,
                      const int col_size=0);
 void set_all_column_types(const unsigned mask=0);

 void rewind(void);
 int is_null(void);
 int eof(void);
 void close(void);

 otl_column_desc* describe_select(int& desc_len);

 otl_ref_cur_stream& operator>>(char& c);
 otl_ref_cur_stream& operator>>(unsigned char& c);
 otl_ref_cur_stream& operator>>(char* s);
 otl_ref_cur_stream& operator>>(unsigned char* s);
 otl_ref_cur_stream& operator>>(int& n);
 otl_ref_cur_stream& operator>>(unsigned& u);
 otl_ref_cur_stream& operator>>(short& sh);
 otl_ref_cur_stream& operator>>(long int& l);
 otl_ref_cur_stream& operator>>(float& f);
 otl_ref_cur_stream& operator>>(double& d);
 otl_ref_cur_stream& operator>>(otl_long_string& s); // read the LOB from the stream
 otl_ref_cur_stream& operator>>(otl_datetime& dt); // read date/time info from the stream
 otl_ref_cur_stream& operator>>(otl_lob_stream& lob); 
                      // read reference to CLOB/BLOB from otl_ref_stream 
                      // into otl_lob_stream (OCI8). In other words,
                      // initialize otl_lob_stream for reading CLOB/BLOB 
                      // in stream mode
 otl_refcur_stream& operator>>(std::string& s); // read the ANSI C++ std::string
}; // end of otl_refcur_stream
Also, see examples


Prev Next Contents Go Home

Copyright © 1996, 2001, Sergei Kuchin, email: skuchin@sprynet.com, kuchin@hotmail.com .

Permission to use, copy, modify and redistribute this document for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies. 1