& blob_type);
75 sql=
string(
" IF EXISTS (select * from sysobjects WHERE name = '");
82 while( lcmd->HasMoreResults() ) {
83unique_ptr<CDB_Result>
r(lcmd->Result());
88 sql+=
" int_val int not null, \n";
89 sql+=
" fl_val real not null, \n";
90 sql+=
" date_val datetime not null, \n";
91 sql+=
" str_val varchar(255) null, \n";
92 sql+=
" txt_val "+ blob_type +
" null, \n";
93 sql+=
" primary key clustered(int_val) \n";
99 while( lcmd->HasMoreResults() ) {
100unique_ptr<CDB_Result>
r(lcmd->Result());
111 if(blob_type[0] ==
'n') {
114pTxt.
Append(
"This is a test string.");
119bcp->Bind(0, &int_val);
120bcp->Bind(1, &fl_val);
121bcp->Bind(2, &date_val);
122bcp->Bind(3, &str_val);
127fl_val = float(
i+ 0.999);
128date_val = date_val.
Value();
159txt.
Append(
"This text will replace a text in the table.");
160 for(
int i= 0;
i< 4000; ++
i) {
174txt.
Append(
" Let\xe2\x80\x99s make it long!");
180unique_ptr<CDB_CursorCmd> upd(
GetConnection().Cursor(
"upd",
182 " for update of txt_val", 0));
185unique_ptr<CDB_Result> crres(upd->Open());
187 while( crres->Fetch() ) {
190 if( v.
Value() == 2 ) {
193upd->UpdateBlob(1, txt);
200cout <<
"\n<RESULTSET blob_type=\""<< blob_type <<
"\">\n\n";
201 ShowResults(
"select int_val,fl_val,date_val,str_val,txt_val from "+
203cout <<
"</RESULTSET>\n";
237 int main(
intargc,
const char* argv[])
int RunOneSample(const string &blob_type)
string GetTableName(void) const
virtual ~CDbapiCursorApp(void)
void CreateTable(const string &table_name, const string &blob_type)
function CreateTable is creating table in the database
virtual int RunSample(void)
void DeleteTable(const string &table_name)
I_DriverContext & GetDriverContext(void)
Get the driver context (for the driver specified in the command line)
void SetDatabaseParameter(const string &name, const string &value)
Set database connection parameter.
const string & GetDriverName(void) const
Return current driver name.
CDB_Connection & GetConnection(void)
Get connection created using server, username and password specified in the application command line.
EServerType GetServerType(void) const
Return current server type.
void ShowResults(const string &query)
Delete table if it exists ShowResults is printing resuts on screen.
int main(int argc, const char *argv[])
static const char table_name[]
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
static CDB_UserHandler & GetDefault(void)
virtual bool HandleIt(CDB_Exception *ex)=0
Handle the exceptions resulting from a native API call, one-by-one.
virtual bool SetMaxBlobSize(size_t nof_bytes)=0
Set maximal size for BLOB data.
virtual size_t Append(const void *buff, size_t nof_bytes)
virtual bool MoveTo(size_t byte_number)
const CTime & Value(void) const
void SetEncoding(EBulkEnc e)
@ eCurrent
Use current time. See also CCurrentTime.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4