当前位置: 首页>>代码示例>>C++>>正文


C++ otl_connect::set_max_long_size方法代码示例

本文整理汇总了C++中otl_connect::set_max_long_size方法的典型用法代码示例。如果您正苦于以下问题:C++ otl_connect::set_max_long_size方法的具体用法?C++ otl_connect::set_max_long_size怎么用?C++ otl_connect::set_max_long_size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在otl_connect的用法示例。


在下文中一共展示了otl_connect::set_max_long_size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: select

void select()
{ 
 otl_long_string f2(70000); // define long string variable
 db.set_max_long_size(70000); // set maximum long string size for connect object

 otl_stream i(5, // buffer size can be > 1
              "select * from test_tab where f1>=:f11<int> and f1<=:f12<int>*2",
                 // SELECT statement
              db // connect object
             ); 
   // create select stream
 
 int f1;

 i<<8<<8; // assigning :f11 = 8, :f12 = 8
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<f2[0]<<f2[f2.len()-1]<<", len="<<f2.len()<<endl;
 }

 i<<4<<4; // assigning :f11 = 4, :f12 = 4
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<f2[0]<<f2[f2.len()-1]<<", len="<<f2.len()<<endl;
 }

}
开发者ID:008fy,项目名称:otl,代码行数:33,代码来源:ex623_odbc.cpp

示例2: select

void select()
{ 
 string f2;
 db.set_max_long_size(7000); // set maximum long string size for connect object

 otl_stream i(1, // buffer size needs to be set to 1 for operations with LOBs
              "select * from test_tab where f1>=:f11<int> and f1<=:f12<int>*2",
                 // SELECT statement
              db // connect object
             ); 
   // create select stream
 
 float f1;

 i<<8<<8;
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<f2[0]<<f2[f2.length()-1]<<", len="
      <<(int)f2.length()<<endl;
 }

 i<<4<<4;
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<f2[0]<<f2[f2.length()-1]<<", len="
      <<(int)f2.length()<<endl;
 }

}
开发者ID:HJolin1986,项目名称:otl,代码行数:35,代码来源:ex426_odbc.cpp

示例3: select

void select()
{ 
 otl_long_unicode_string f2(80000); // define long string variable
 db.set_max_long_size(80000); // set maximum long string size for connect object

 otl_stream i(10, // buffer size
              "select f1, f2 "
              "from test_tab "
              "where f1>=:f11<int> "
              " and f1<=:f12<int>*2",
                 // SELECT statement
              db // connect object
             ); 
   // create select stream
 
 int f1;

 i<<8<<8; // assigning :f11 = 8, :f12 = 8 
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2=";
  for(int j=0;j<f2.len();++j)
    if(f2[j]<128)
      cout<<static_cast<char>(f2[j]);
    else
      cout<<static_cast<int>(f2[j])<<" ";
  cout<<endl; 
 }

}
开发者ID:HJolin1986,项目名称:otl,代码行数:33,代码来源:ex673_db2.cpp

示例4: select

void select()
{ 
 string f2;
 db.set_max_long_size(80000); // set maximum long string size for connect object

 otl_stream i(10, // buffer size
              "select f1, f2 "
              "from test_tab "
              "where f1>=:f11<int> "
              " and f1<=:f12<int>*2",
                 // SELECT statement
              db // connect object
             ); 
   // create select stream
 
 int f1;

 i<<8<<8; // assigning :f11 = 8, :f12 = 8 
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<f2<<endl;
 }

}
开发者ID:HJolin1986,项目名称:otl,代码行数:27,代码来源:ex672_db2.cpp

示例5: insert

void insert()
// insert rows into table
{ 
  otl_long_unicode_string f2(80000); // define long unicode string variable
 db.set_max_long_size(80000); // set maximum long string size for connect object
 otl_stream o(10, // buffer size 
              "insert into test_tab values(:f1<int>,:f2<varchar_long>) ",
                 // SQL statement
              db // connect object
             );

 for(int i=1;i<=20;++i){
  f2[0]='<';
  f2[1]='T';
  f2[2]='A';
  f2[3]='G';
  f2[4]='>';
  f2[5]=1111; // Unicode character (decimal code of 1111)  
  f2[6]=2222; // Unicode character (decimal code of 2222)
  f2[7]=3333; // Unicode character (decimal code of 3333)  
  f2[8]=4444; // Unicode character (decimal code of 4444)  
  f2[9]='<';
  f2[10]='/';
  f2[11]='T';
  f2[12]='A';
  f2[13]='G';
  f2[14]='>';
  f2.set_len(15);
  o<<i<<f2;
 }

}
开发者ID:HJolin1986,项目名称:otl,代码行数:32,代码来源:ex673_db2.cpp

示例6: update

void update()
// insert rows in table
{ 

 otl_long_string f2(70000); // define long string variable
 db.set_max_long_size(70000); // set maximum long string size for connect object

 otl_stream o(1, // buffer size has to be set to 1 for operations with LOBs
              "update test_tab "
              "   set f2=empty_clob() "
              "where f1=:f1<int> "
              "returning f2 into :f2<clob> ",
                 // SQL statement
              db // connect object
             );

 for(int j=0;j<33000;++j){
  f2[j]='#';
 }

 f2[33000]='?';
 f2.set_len(33001);

 o<<5<<f2; // update row for which f1=5

}
开发者ID:008fy,项目名称:otl,代码行数:26,代码来源:ex41_oci8.cpp

示例7: insert

void insert()
// insert rows into table
{ 
 db.set_max_long_size(80000); // set maximum long string size for connect object
 otl_stream o(10, // buffer size
              "insert into test_tab values(:f1<int>,:f2<varchar_long>) ",
                 // SQL statement
              db // connect object
             );
OTL_UNICODE_CHAR_TYPE tmp[80001]; // Null terminated Unicode character array.

 for(int i=1;i<=20;++i){
  tmp[0]='<';
  tmp[1]='T';
  tmp[2]='A';
  tmp[3]='G';
  tmp[4]='>';
  tmp[5]=1111; // Unicode character (decimal code of 1111)  
  tmp[6]=2222; // Unicode character (decimal code of 2222)
  tmp[7]=3333; // Unicode character (decimal code of 3333)  
  tmp[8]=4444; // Unicode character (decimal code of 4444)  
  tmp[9]='<';
  tmp[10]='/';
  tmp[11]='T';
  tmp[12]='A';
  tmp[13]='G';
  tmp[14]='>';
  tmp[15]=0;
  OTL_UNICODE_STRING_TYPE tmp_str(tmp);
  o<<i<<tmp_str;
 }

}
开发者ID:008fy,项目名称:otl,代码行数:33,代码来源:ex674_db2.cpp

示例8: select

void select()
{ 
 otl_long_string f2(80000); // define long string variable
 db.set_max_long_size(80000); // set maximum long string size for connect object

 otl_stream i(10, // buffer size. To read XML as CLOBs, it can be set to a size greater than 1
              "select f1, to_clob(f2) "
              "from test_tab "
              "where f1>=:f11<int> "
              " and f1<=:f12<int>*2",
                 // SELECT statement
              db // connect object
             ); 
   // create select stream
 
 int f1;

 i<<8<<8; // assigning :f11 = 8, :f12 = 8 
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<reinterpret_cast<char*>(&f2[0])<<endl;
 }

}
开发者ID:008fy,项目名称:otl,代码行数:27,代码来源:ex664_oci9.cpp

示例9: insert

void insert()
// insert rows into table
{ 

 db.set_max_long_size(80000); // set maximum long string size for connect object
 otl_stream o(1, // buffer size needs to be set to 1 when varchar_long is used
              "insert into test_tab values(:f1<int>,:f2<varchar_long>) ",
                 // SQL statement
              db // connect object
             );
 char tmp[80001];

 for(int i=1;i<=20;++i){
#if defined(_MSC_VER)
#if (_MSC_VER >= 1400) // VC++ 8.0 or higher
   sprintf_s(reinterpret_cast<char*>(tmp),sizeof(tmp),"<TAG>MyXML%d</TAG>",i);
#else
  sprintf(reinterpret_cast<char*>(tmp),"<TAG>MyXML%d</TAG>",i);
#endif
#else
  sprintf(reinterpret_cast<char*>(tmp),"<TAG>MyXML%d</TAG>",i);
#endif
  int len=static_cast<int>(strlen(tmp));
  otl_long_string f2(tmp,len,len); // define long string variable
  o<<i<<f2;
 }

}
开发者ID:008fy,项目名称:otl,代码行数:28,代码来源:ex664_oci9.cpp

示例10: insert

void insert(void)
// insert rows into table
{ 

 otl_long_string f2(1000); // define long string variable
 db.set_max_long_size(1000); // set maximum long string size for connect object

 otl_stream o(10, // buffer size
              "insert into test_tab values(:f1<int>,:f2<varchar_long>)", 
                 // SQL statement
              db // connect object
             );

// Total memory consumption for the buffer equals 1000 * 10, 
// max_long_size * buffer size


 for(int i=1;i<=20;++i){
  for(int j=0;j<50;++j)
   f2[j]='*';
  f2[50]='?';
  f2.set_len(51);
  o<<i<<f2;
 }
}
开发者ID:008fy,项目名称:otl,代码行数:25,代码来源:ex558_odbc.cpp

示例11: insert

void insert()
// insert rows into table
{ 
 db.set_max_long_size(80000); // set maximum long string size for connect object
 otl_stream o(10, // buffer size
              "insert into test_tab values(:f1<int>,:f2<varchar_long>) ",
                 // SQL statement
              db // connect object
             );
 char tmp[80001];

 for(int i=1;i<=20;++i){
  sprintf(tmp,"<TAG>MyXML%d</TAG>",i);
  string tmp_str(tmp);
  o<<i<<tmp_str;
 }

}
开发者ID:HJolin1986,项目名称:otl,代码行数:18,代码来源:ex672_db2.cpp

示例12: select

void select()
{ 
 otl_long_unicode_string f2(70000); // define long string variable
 db.set_max_long_size(70000); // set maximum long string size for connect object

 otl_stream i(10, // buffer size
              "begin "
              "  open :cur for "
              "  select * from test_tab "
              "  where f1>=:f<int> and f1<=:f*2; "
              "end;",
                 // SELECT statement
              db, // connect object
              ":cur" // reference cursor placeholder name
             ); 
   // create select stream
 
 float f1;

 i<<8; // assigning :f = 8
   // SELECT automatically executes when all input variables are

   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="
      <<static_cast<char>(f2[0]) // first 128 characters of Unicode are ASCII
      <<static_cast<char>(f2[f2.len()-1])<<", len="<<f2.len()<<endl;
 }

 i<<4; // assigning :f = 4
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<static_cast<char>(f2[0])
      <<static_cast<char>(f2[f2.len()-1])<<", len="<<f2.len()<<endl;
 }

}
开发者ID:HJolin1986,项目名称:otl,代码行数:42,代码来源:ex181_oci8.cpp

示例13: select

void select()
{ 
 db.set_max_long_size(5); // max size + 1 Unicode character for traling NULL
 otl_stream i(50, // buffer size can be > 1
              "select * from test_tab "
              "where f1>=:f11<int> "
              "  and f1<=:f12<int>*2",
                 // SELECT statement
              db // connect object
             ); 
   // create select stream
 
 int f1;
 OTL_UNICODE_STRING_TYPE f2;

 i<<8<<8; // assigning :f11 = 8, f12 = 8
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1;
  i>>f2;
  cout<<"f1="<<f1<<", f2=";
   for(size_t j=0;j<f2.length();++j)
     cout<<" "<<f2[j];
   cout<<endl;
 }

 i<<4<<4; // assigning :f11 = 4, :f12 = 4
   // SELECT automatically executes when all input variables are
   // assigned. First portion of output rows is fetched to the buffer

 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2=";
   for(size_t j=0;j<f2.length();++j)
     cout<<" "<<f2[j];
   cout<<endl;
 }

}
开发者ID:HJolin1986,项目名称:otl,代码行数:41,代码来源:ex368_odbc.cpp

示例14: select

void select(void)
{ 
 otl_long_string f2(7000); // define long string variable
 db.set_max_long_size(7000); // set maximum long string size for connect object

 otl_stream i(1, // buffer size needs to be set to 1 in case of TEXT columns
              "select * from test_tab",
                 // SELECT statement
              db // connect object
             ); 
   // create select stream
 
 int f1;


 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<f2[0]<<f2[f2.len()-1]<<", len="<<f2.len()<<endl;
 }

}
开发者ID:008fy,项目名称:otl,代码行数:21,代码来源:ex326_odbc.cpp

示例15: select

void select(void)
{ 
 otl_long_string f2(7000); // define long string variable
 db.set_max_long_size(7000); // set maximum long string size for connect object

 otl_stream i(50, // PostgreSQL 8.1 and higher, the buffer can be > 1
              "select * from test_tab",
                 // SELECT statement
              db // connect object
             ); 
   // create select stream
 
 int f1;


 while(!i.eof()){ // while not end-of-data
  i>>f1>>f2;
  cout<<"f1="<<f1<<", f2="<<f2[0]<<f2[f2.len()-1]<<", len="<<f2.len()<<endl;
 }

}
开发者ID:008fy,项目名称:otl,代码行数:21,代码来源:ex143_odbc.cpp


注:本文中的otl_connect::set_max_long_size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。