博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
otl翻译(11) -- OTL的迭代器
阅读量:7017 次
发布时间:2019-06-28

本文共 3858 字,大约阅读时间需要 12 分钟。

OTL stream read iterator

这个类是一个像传统的JDBC中的getter()操作一样扩展了OTL流的模板类。它现在还不支持UNICODE字符集。它对otl_refcur_stream和otl_stream的使用基本相同(在ORACLE8版本里面)。

模板的定义如下:

template<typename OTLStream,

         typename OTLException

#if !defined(OTL_ORA7)

  // when any flavor of OTL but OTL_ORA7 is defined:

  // OTL_ORA8, OTL_ORA8I, OTL_ORA9I, OTL_ORA10G,

  // OTL_ORA10G_R2, OTL_ODBC, OTL_DB2_CLI

         ,typename OTLLobStream

#endif

        >

class otl_stream_read_iterator{

//...

}

下面为相关的函数与说明:

 

序号

函数

说明

1

otl_stream_read_iterator();

默认构造函数

2

~otl_stream_read_iterator();

析构函数

3

otl_stream_read_iterator(OTLStream& s);

构造函数。把它附着到一个流上面

4

void attach(OTLStream& s);

附加到一个流上面

5

void reattach();

重新附加到一个相同的流上面。

它是在对同一个游标流关闭后再打开的情况下使用。

6

void detach();

从流中分离出来

7

bool next_row();

读取下一条记录。如果有下一条记录,则返回真。如果没有下一条记录直接到达结尾,则返回假。

8

const otl_var_desc* describe(int& var_desc_len);

解析输出字段的结构。参数为参数个数。相同的功能与otl_stream::describe_out_vars()。

9

void get(const int pos, char& c);

通过位置读取一个字符

10

void get(const int pos, unsigned char& c);

通过位置读取一个无符号字符

11

void get(const int pos, char* s);

通过位置读取一个字符串

12

void get(const int pos, unsigned char* s);

通过位置读取一个无符号字符串

13

void get(const int pos, int& n);

通过位置读取一个32位整型

14

void get(const int pos, unsigned int& n);

通过位置读取一个32位无符号整型

15

void get(const int pos, short int& n);

通过位置读取一个短整型

16

void get(const int pos, long int& n);

通过位置读取一个长整型

17

void get(const int pos, float& n);

通过位置读取一个4字节长度的浮点型

18

void get(const int pos, double& n);

通过位置读取一个8字节长度的浮点型

19

void get(const int pos, OTL_BIGINT& n);

读取一个有符号的64位整型

20

void get(const int pos, OTL_STRING_CONTAINER& s);

当定义了OTL_STL宏的时候读取string;

当定义了OTL_STLPORT宏的时候读取string;

当定义了OTL_ACE宏的时候读取ACE_TString;

当定义了OTL_USER_DEFINED_STRING_CLASS_ON宏的时候,读取USER_DEFINED_STRING_CLASS;

它还可以用来读取VARCHAR/CHAR/LONG/TEXT等大对象。

21

void get(const int pos, otl_long_string& s);

读取otl_long_string类型

22

void get(const int pos, otl_long_string*& s);

通过引用的指针读取otl_long_string类型。这个在读取大对象的时候性能比上面的更好。

23

void get(const int pos, otl_lob_stream*& s);

仅在OCI8/9/10/11时候适用。

从一个大对象流中读取大对象。需要在LOG_STREAM_MODE模式下。

24

void get(const int pos, otl_datetime& s);

通过位置读取一个日期时间类型

25

bool is_null(const int pos);

如果指定位置为空,则返回真。否则返回假。

26

void get(const char* var_name, char& c);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量名读取一个字符

27

void get(const char* var_name, unsigned char& c);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个无符号字符

28

void get(const char* var_name, char* s);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定的变量读取一个字符串

29

void get(const char* var_name, unsigned char* s);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个无符号字符串

30

void get(const char* var_name, int& n);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个整型

31

void get(const char* var_name, unsigned int& n);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个无符号整型

32

void get(const char* var_name, short int& n);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个短整型

33

void get(const char* var_name, long int& n);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个长整型

34

void get(const char* var_name, float& n);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个4字节长度的浮点型

35

void get(const char* var_name, double& n);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个8字节长度的浮点型

36

void get(const char* var_name, OTL_BIGINT& n);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个64位长整型

37

void get(const char* var_name, OTL_STRING_CONTAINER& s);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

在定义了OTL_STL的情况下读取一个std::string类型。可以用来读取VARCHAR/CHAR/TEXT等类型。

38

void get(const char* var_name, otl_long_string& s);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

读取一个otl_long_string类型

39

void get(const char* var_name, otl_long_string*& s);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

读取一个otl_long_string类型引用指针。在读取大对象的时候性能比较好。

40

void get(const char* var_name, otl_lob_stream*& s);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

读取一个otl_lob_stream对象的引用指针

41

void get(const char* var_name, otl_datetime& s);

需要定义OTL_STL或OTL_STLPORT或OTL_ACE宏。

通过指定变量读取一个日期时间类型

42

bool is_null(const char* var_name);

如果指定的变量为空,返回真,否则返回假。

转载地址:http://xpzxl.baihongyu.com/

你可能感兴趣的文章
VMware驱动程序"vmci.sys"的版本不正确 怎么解决
查看>>
除了默认的docker0网桥,启动Docker服务怎么指定使用的网桥
查看>>
Maven Tips
查看>>
win7下匿名ftp的搭建
查看>>
嵌入式开发 NVIDIA官方资源汇总
查看>>
Saltstack配置管理-业务引用haproxy
查看>>
jQuery|event的属性和方法
查看>>
linux 下将tomcat注册成服务并开机启动
查看>>
织梦 dedecms 文章内容 body 内部超链接替换为空
查看>>
js格式化日期
查看>>
详解BSCI实验五、配置PIM auto-rp
查看>>
SO_DONTROUTE和SO_BINDTODEVICE的深层次分析
查看>>
WINserver路由服务之多网段管控
查看>>
网络基础CCNP|SDN与日志
查看>>
Python3.X Socket 一个编码与解码的坑
查看>>
vs2015未能正确加载“ProviderPackage”包。
查看>>
PHP带头大哥讲解几种综合PHP网络服务器系统的选择!
查看>>
MySQL数据表所有操作命令
查看>>
使用SQLRootKit网页数据库后门控制案例
查看>>
Jmeter性能测试-----参数化方法CSVRead函数
查看>>