本文整理汇总了C++中OracleEnv::ctx方法的典型用法代码示例。如果您正苦于以下问题:C++ OracleEnv::ctx方法的具体用法?C++ OracleEnv::ctx怎么用?C++ OracleEnv::ctx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OracleEnv
的用法示例。
在下文中一共展示了OracleEnv::ctx方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prepareNonSubstructure
void MangoShadowFetch::prepareNonSubstructure (OracleEnv &env)
{
env.dbgPrintf("preparing shadow table for non-substructure match\n");
_fetch_type = _NON_SUBSTRUCTURE;
_need_xyz = _context.substructure.needCoords();
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
if (_need_xyz)
{
_lob_cmf.reset(new OracleLOB(_env.ref()));
_lob_xyz.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT mol_rowid, cmf, xyz FROM %s", _table_name.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
_statement->defineBlobByPos(3, _lob_xyz.ref());
}
else
{
_lob_cmf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT mol_rowid, cmf FROM %s", _table_name.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
}
_counting_select.clear();
}
示例2: prepareMass
void MangoShadowFetch::prepareMass (OracleEnv &env)
{
env.dbgPrintf("preparing shadow table for molecular mass match\n");
QS_DEF(Array<char>, where);
{
ArrayOutput where_out(where);
where_out.printf("");
where_out.writeChar(0);
}
_fetch_type = _MASS;
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_statement->append("SELECT mol_rowid FROM %s WHERE mass >= :mass_min AND mass <= :mass_max",
_table_name.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
ArrayOutput output(_counting_select);
output.printf("SELECT COUNT(*) FROM %s WHERE WHERE mass >= :mass_min AND mass <= :mass_max",
_table_name.ptr());
}
示例3: prepareTautomer
void MangoShadowFetch::prepareTautomer (OracleEnv &env, int right_part)
{
if (right_part == 1)
env.dbgPrintf("preparing shadow table for tautomer match\n");
else
env.dbgPrintf("preparing shadow table for non-tautomer match\n");
_fetch_type = _TAUTOMER;
_right_part = right_part;
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_lob_cmf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT mol_rowid, cmf FROM %s", _table_name.ptr());
if (right_part == 1)
_statement->append(" WHERE gross = :gross OR gross LIKE :grossh");
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
if (right_part == 1)
{
ArrayOutput output(_counting_select);
output.printf("SELECT COUNT(*) FROM %s WHERE gross = :gross", _table_name.ptr());
}
else
_counting_select.clear();
}
示例4: prepareExact
void RingoShadowFetch::prepareExact (OracleEnv &env, int right_part)
{
RingoExact & instance = _context.exact;
if (right_part == 1)
env.dbgPrintf("preparing shadow table for exact\n");
else
env.dbgPrintf("preparing shadow table for non-exact\n");
_fetch_type = _EXACT;
_right_part = right_part;
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_lob_crf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT sh.rid, sh.crf FROM %s sh", _table_name.ptr());
if (right_part == 1)
_statement->append(" WHERE hash = :hash");
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_crf.ref());
if (_right_part == 1)
{
const char *hash_str = instance.getQueryHashStr();
_statement->bindStringByName(":hash", hash_str, strlen(hash_str) + 1);
}
ArrayOutput output_cnt(_counting_select);
output_cnt.printf("SELECT COUNT(*) FROM %s sh", _table_name.ptr());
if (right_part == 1)
output_cnt.printf(" WHERE hash = :hash");
}
示例5: prepareNonTautomerSubstructure
void MangoShadowFetch::prepareNonTautomerSubstructure (OracleEnv &env)
{
env.dbgPrintf("preparing shadow table for non-tautomer-substructure match\n");
_fetch_type = _NON_TAUTOMER_SUBSTRUCTURE;
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_lob_cmf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT mol_rowid, cmf FROM %s", _table_name.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
_counting_select.clear();
}
示例6: prepareExact
void MangoShadowFetch::prepareExact (OracleEnv &env, int right_part)
{
const MangoExact & instance = _context.exact;
if (right_part == 1)
env.dbgPrintf("preparing shadow table for exact\n");
else
env.dbgPrintf("preparing shadow table for non-exact\n");
_fetch_type = _EXACT;
_right_part = right_part;
_need_xyz = instance.needCoords();
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_lob_cmf.reset(new OracleLOB(_env.ref()));
_statement->append("SELECT sh.mol_rowid, sh.cmf");
if (_need_xyz)
_statement->append(", sh.xyz", _table_name.ptr());
_statement->append(" FROM %s sh", _table_name.ptr());
QS_DEF(Array<char>, table_copies);
QS_DEF(Array<char>, where_clause);
_prepareExactQueryStrings(table_copies, where_clause);
_statement->append(table_copies.ptr());
_statement->append(where_clause.ptr());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineBlobByPos(2, _lob_cmf.ref());
if (_need_xyz)
{
_lob_xyz.reset(new OracleLOB(_env.ref()));
_statement->defineBlobByPos(3, _lob_xyz.ref());
}
ArrayOutput output_cnt(_counting_select);
output_cnt.printf("SELECT COUNT(*) FROM %s sh", _table_name.ptr());
output_cnt.printf("%s", table_copies.ptr());
output_cnt.printf("%s", where_clause.ptr());
}
示例7: prepareGross
void MangoShadowFetch::prepareGross (OracleEnv &env, int right_part)
{
MangoGross & instance = _context.gross;
env.dbgPrintf("preparing shadow table for gross formula match\n");
_fetch_type = _GROSS;
_right_part = right_part;
_env.reset(new OracleEnv(env.ctx(), env.logger()));
_statement.reset(new OracleStatement(_env.ref()));
_statement->append("SELECT mol_rowid, gross FROM %s ", _table_name.ptr());
if (*instance.getConditions() != 0 && right_part == 1)
_statement->append("WHERE %s", instance.getConditions());
_statement->prepare();
_statement->defineStringByPos(1, _rowid.ptr(), sizeof(_rowid));
_statement->defineStringByPos(2, _gross, sizeof(_gross));
ArrayOutput output(_counting_select);
output.printf("SELECT COUNT(*) FROM %s WHERE %s", _table_name.ptr(),
instance.getConditions());
}