您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ sqlite3_bind_double函数代码示例

51自学网 2021-06-03 08:14:51
  C++
这篇教程C++ sqlite3_bind_double函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中sqlite3_bind_double函数的典型用法代码示例。如果您正苦于以下问题:C++ sqlite3_bind_double函数的具体用法?C++ sqlite3_bind_double怎么用?C++ sqlite3_bind_double使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: sqlite3_bind_double

void RepoQuery::bindDouble(const char* paramName, double val) {  sqlite3_stmt* stmt = m_stmt.get();  int rc UNUSED =    sqlite3_bind_double(stmt,                        sqlite3_bind_parameter_index(stmt, paramName),                        val);  assert(rc == SQLITE_OK);}
开发者ID:Alienfeel,项目名称:hhvm,代码行数:8,


示例2: sqlite3_bind_double

void Sqlite::insertData(Data* dt) {	int out;	sqlite3_bind_double (insert, 1, dt->getTime());	sqlite3_bind_double (insert, 2, dt->getLatitude());	sqlite3_bind_double (insert, 3, dt->getLongitude());	sqlite3_bind_double (insert, 4, dt->getAltitude());	sqlite3_bind_double (insert, 5, dt->getHeading());	while ((out = sqlite3_step(insert)) != SQLITE_DONE) {		if (out == SQLITE_ERROR) {			std::cerr << "(" << __FILE__ << ":" << __LINE__ << ") "<< sqlite3_errmsg(dbHandle) << std::endl;			throw std::exception();		}	}	sqlite3_reset(insert);}
开发者ID:cameroncros,项目名称:gpsHound,代码行数:17,


示例3: Te2String

bool TeSQLite::updatePolygon(const string& table, TePolygon &p){	errorMessage_ = "";	std::string command = "UPDATE " + table + " SET ";	command += "object_id=?";	command += ", lower_x=?, lower_y=?, upper_x=?, upper_y=?, "; 	command += ", spatial_data=? WHERE geom_id = " + Te2String(p.geomId());	std::string objectId = p.objectId();	char* wkb = 0;	unsigned int wkbSize = 0;	TeWKBGeometryDecoder::encodePolygon(p, wkb, wkbSize);	sqlite3_stmt* recordSet = 0;	int retValue = sqlite3_prepare_v2(_conn, command.c_str(), -1, &recordSet, 0);	if(retValue != SQLITE_OK)	{		errorMessage_ = errorMessage();		return false;	}	sqlite3_bind_text(recordSet, 1, objectId.c_str(), objectId.size(), SQLITE_TRANSIENT);	sqlite3_bind_double(recordSet, 2, p.box().x1());	sqlite3_bind_double(recordSet, 3, p.box().y1());	sqlite3_bind_double(recordSet, 4, p.box().x2());	sqlite3_bind_double(recordSet, 5, p.box().y2());	sqlite3_bind_blob(recordSet, 6, wkb, wkbSize, SQLITE_TRANSIENT);	delete wkb;	retValue = sqlite3_step(recordSet);	if(retValue != SQLITE_DONE)	{		return false;	}	sqlite3_finalize(recordSet);	return true;}
开发者ID:Universefei,项目名称:Terralib-analysis,代码行数:45,


示例4: Q_ASSERT

void SqlQuery::bindValue(int pos, const QVariant& value){    int res = -1;    Q_ASSERT(_stmt);    if( _stmt ) {        switch (value.type()) {        case QVariant::Int:        case QVariant::Bool:            res = sqlite3_bind_int(_stmt, pos, value.toInt());            break;        case QVariant::Double:            res = sqlite3_bind_double(_stmt, pos, value.toDouble());            break;        case QVariant::UInt:        case QVariant::LongLong:            res = sqlite3_bind_int64(_stmt, pos, value.toLongLong());            break;        case QVariant::DateTime: {            const QDateTime dateTime = value.toDateTime();            const QString str = dateTime.toString(QLatin1String("yyyy-MM-ddThh:mm:ss.zzz"));            res = sqlite3_bind_text16(_stmt, pos, str.utf16(),                                      str.size() * sizeof(ushort), SQLITE_TRANSIENT);            break;        }        case QVariant::Time: {            const QTime time = value.toTime();            const QString str = time.toString(QLatin1String("hh:mm:ss.zzz"));            res = sqlite3_bind_text16(_stmt, pos, str.utf16(),                                      str.size() * sizeof(ushort), SQLITE_TRANSIENT);            break;        }        case QVariant::String: {            if( !value.toString().isNull() ) {                // lifetime of string == lifetime of its qvariant                const QString *str = static_cast<const QString*>(value.constData());                res = sqlite3_bind_text16(_stmt, pos, str->utf16(),                                          (str->size()) * sizeof(QChar), SQLITE_TRANSIENT);            } else {                // unbound value create a null entry.                res = SQLITE_OK;            }            break;        }        default: {            QString str = value.toString();            // SQLITE_TRANSIENT makes sure that sqlite buffers the data            res = sqlite3_bind_text16(_stmt, pos, str.utf16(),                                      (str.size()) * sizeof(QChar), SQLITE_TRANSIENT);            break;        }        }    }    if (res != SQLITE_OK) {        qDebug() << Q_FUNC_INFO << "ERROR" << value.toString() << res;    }    Q_ASSERT( res == SQLITE_OK );}
开发者ID:HomeThings,项目名称:client,代码行数:57,


示例5: sqlite3_bind_cbench_value

static int sqlite3_bind_cbench_value(sqlite3_stmt *stmt, int ind, struct value *val){	switch (val->type) {	case VALUE_STRING:		return sqlite3_bind_text(stmt, ind, val->v_str, -1, SQLITE_STATIC);	case VALUE_INT32:		return sqlite3_bind_int(stmt, ind, val->v_int32);	case VALUE_INT64:		return sqlite3_bind_int64(stmt, ind, val->v_int64);	case VALUE_FLOAT:		return sqlite3_bind_double(stmt, ind, val->v_flt);	case VALUE_DOUBLE:		return sqlite3_bind_double(stmt, ind, val->v_dbl);	default:		printk(KERN_ERR "bind value: unknown value/n");		return -1;	}}
开发者ID:scosu,项目名称:cbenchsuite,代码行数:18,


示例6: CheckBindResult

void SqlConnection::DataCommand::BindFloat(    SqlConnection::ArgumentIndex position,    float value){    CheckBindResult(sqlite3_bind_double(m_stmt, position,                                        static_cast<double>(value)));    LogPedantic("SQL data command bind float: ["                << position << "] -> " << value);}
开发者ID:tizenorg,项目名称:platform.framework.web.wrt-commons,代码行数:9,


示例7: js_db_query

static JSBooljs_db_query(JSContext *cx, JSObject *obj, uintN argc,            jsval *argv, jsval *rval){    const char *query;    js_db_t *jd = JS_GetPrivate(cx, obj);    int rc;    if(js_db_check(cx, jd))        return JS_FALSE;    if(!JS_ConvertArguments(cx, argc, argv, "s", &query))        return JS_FALSE;    if(jd->jd_stmt) {        sqlite3_finalize(jd->jd_stmt);        jd->jd_stmt = NULL;    }    rc = db_prepare(jd->jd_db, &jd->jd_stmt, query);    if(rc != SQLITE_OK) {        if(jd->jd_transaction && rc == SQLITE_LOCKED) {            js_txn_deadlock(cx, jd);            return JS_FALSE;        }        *rval = JSVAL_FALSE;        return JS_TRUE;    }    sqlite3_stmt *stmt = jd->jd_stmt;    for(int i = 1; i < argc; i++) {        jsval v = argv[i];        if(JSVAL_IS_NULL(v) || JSVAL_IS_VOID(v)) {            sqlite3_bind_null(stmt, i);        } else if(JSVAL_IS_INT(v)) {            sqlite3_bind_int(stmt, i, JSVAL_TO_INT(v));        } else if(JSVAL_IS_BOOLEAN(v)) {            sqlite3_bind_int(stmt, i, JSVAL_TO_BOOLEAN(v));        } else if(JSVAL_IS_DOUBLE(v)) {            double d;            if(JS_ValueToNumber(cx, v, &d))                sqlite3_bind_double(stmt, i, d);        } else if(JSVAL_IS_STRING(v)) {            JSString *s = JS_ValueToString(cx, v);            sqlite3_bind_text(stmt, i, JS_GetStringBytes(s), -1, SQLITE_STATIC);        } else {            JS_ReportError(cx, "Unable to bind argument %d, invalid type", i);            sqlite3_finalize(stmt);            return JS_FALSE;        }    }    *rval = JSVAL_TRUE;    return js_stmt_step(cx, jd, rval);}
开发者ID:Bibamaru,项目名称:showtime,代码行数:57,


示例8: bind

 void bind(int where, double d) {     int rc = sqlite3_bind_double(this->_s, where, d);     if(rc != SQLITE_OK)     {         exception e("Could not bind double.");         throw e;     } }
开发者ID:glycos,项目名称:libsqlitepp,代码行数:9,


示例9: sqlite3_bind_double

int CSQLiteStmt::bind(int nParam, const double dValue){	if( NULL == m_pStmt )	{		return -ERROR_FUNCTION_FAILED;	}	return sqlite3_bind_double(m_pStmt, nParam, dValue);}
开发者ID:idkwim,项目名称:_MyLib,代码行数:9,


示例10: operator

 bool operator() (double val) {     if (sqlite3_bind_double(stmt_, index_ , val ) != SQLITE_OK)     {         std::cerr << "cannot bind " << val << "/n";         return false;     }     return true; }
开发者ID:ClaudioFloreani,项目名称:mapnik,代码行数:9,


示例11: osux_database_bind_double

int osux_database_bind_double(osux_database *db, char const *name, double d){    int index = sqlite3_bind_parameter_index(db->prepared_query, name);    if (sqlite3_bind_double(db->prepared_query, index, d) != SQLITE_OK) {        osux_debug("%s/n", sqlite3_errmsg(get_handle(db)));        return -OSUX_ERR_DATABASE;    }    return 0;}
开发者ID:tomtix,项目名称:osux,代码行数:9,


示例12: DB_Record_sensor_values_short

int DB_Record_sensor_values_short(float sensor_value, float measured_timestamp){#if DEVICE_DEBUG    printf("DB_Record_sensor_values_short./n");#endif    if (pthread_mutex_trylock(&db_token) == 0)    {        if (sqlite3_prepare(db, sensor_values_short, strlen(sensor_values_short), &stmt, NULL) != SQLITE_OK)        {#if DEVICE_DEBUG            printf("DB_Record_sensor_values_short: error occur while sqlite3_prepare./n");#endif            return - 1;        }        if (sqlite3_bind_double(stmt, 1, sensor_value) != SQLITE_OK)        {#if DEVICE_DEBUG            printf("DB_Record_sensor_values_short: error occur while sqlite3_bind_double./n");#endif            return -1;        }        if (sqlite3_bind_double(stmt, 2, measured_timestamp) != SQLITE_OK)        {#if DEVICE_DEBUG            printf("DB_Record_sensor_values_short: error occur while sqlite3_bind_double./n");#endif            return -1;        }        sqlite3_step(stmt);  // Run SQL INSERT        sqlite3_reset(stmt); // Clear statement handle for next use        pthread_mutex_unlock(&db_token);    }    else    {#if DEVICE_DEBUG        printf("Cannot access db token./n");#endif        return - 1;    }    return 0;}
开发者ID:tqkhcmut,项目名称:SensorHostWindow,代码行数:44,


示例13: _wi_sqlite3_bind_statement

static void _wi_sqlite3_bind_statement(wi_sqlite3_statement_t *statement, va_list ap) {	wi_string_t					*string;	wi_runtime_instance_t		*instance;	wi_runtime_id_t				id;	wi_uinteger_t				index;	int							result;		index = 1;		while((instance = va_arg(ap, wi_runtime_instance_t *))) {		id			= wi_runtime_id(instance);		result		= SQLITE_OK;				if(id == wi_string_runtime_id()) {			result = sqlite3_bind_text(statement->statement, index, wi_string_cstring(instance), wi_string_length(instance), SQLITE_STATIC);		}		else if(id == wi_number_runtime_id()) {			switch(wi_number_storage_type(instance)) {				case WI_NUMBER_STORAGE_INT8:				case WI_NUMBER_STORAGE_INT16:				case WI_NUMBER_STORAGE_INT32:				case WI_NUMBER_STORAGE_INT64:					result = sqlite3_bind_int64(statement->statement, index, wi_number_int64(instance));					break;									case WI_NUMBER_STORAGE_FLOAT:				case WI_NUMBER_STORAGE_DOUBLE:					result = sqlite3_bind_double(statement->statement, index, wi_number_double(instance));					break;			}		}		else if(id == wi_uuid_runtime_id()) {			string = wi_uuid_string(instance);						result = sqlite3_bind_text(statement->statement, index, wi_string_cstring(string), wi_string_length(string), SQLITE_STATIC);		}		else if(id == wi_date_runtime_id()) {			string = wi_date_sqlite3_string(instance);						result = sqlite3_bind_text(statement->statement, index, wi_string_cstring(string), wi_string_length(string), SQLITE_STATIC);		}		else if(id == wi_null_runtime_id()) {			result = sqlite3_bind_null(statement->statement, index);		}		else if(id == wi_data_runtime_id()) {			result = sqlite3_bind_blob(statement->statement, index, wi_data_bytes(instance), wi_data_length(instance), SQLITE_STATIC);		}		else {			WI_ASSERT(0, "%@ is not a supported data type", instance);		}				WI_ASSERT(result == SQLITE_OK, "error %d while binding parameter %u", result, index);				index++;	}}
开发者ID:ProfDrLuigi,项目名称:zanka,代码行数:56,


示例14: db_sqlite_bind_values

static int db_sqlite_bind_values(sqlite3_stmt* stmt, const db_val_t* v, const int n){	int i, ret;	if (n>0 && v) {		for (i=0; i<n; i++) {			if (VAL_NULL(v+i)) {				ret=sqlite3_bind_null(stmt, i+1);				goto check_ret;			}			switch(VAL_TYPE(v+i)) {				/* every param has '+1' index because in sqlite the leftmost				 * parameter has index '1' */				case DB_INT:					ret=sqlite3_bind_int(stmt, i+1, VAL_INT(v+i));					break;				case DB_BIGINT:					ret=sqlite3_bind_int64(stmt, i+1, VAL_BIGINT(v+i));					break;				case DB_DOUBLE:					ret=sqlite3_bind_double(stmt, i+1, VAL_DOUBLE(v+i));					break;				case DB_STRING:					ret=sqlite3_bind_text(stmt, i+1, VAL_STRING(v+i),											strlen(VAL_STRING(v+i)), SQLITE_STATIC);					break;				case DB_STR:					ret=sqlite3_bind_text(stmt, i+1, VAL_STR(v+i).s,											VAL_STR(v+i).len, SQLITE_STATIC);					break;				case DB_DATETIME:					ret=sqlite3_bind_int64(stmt, i+1, (long int)VAL_TIME(v+i));					break;				case DB_BLOB:					ret=sqlite3_bind_blob(stmt, i+1, (void*)VAL_BLOB(v+i).s,											VAL_BLOB(v+i).len, SQLITE_STATIC);					break;				case DB_BITMAP:					ret=sqlite3_bind_int(stmt, i+1, (int)VAL_BITMAP(v+i));					break;				default:					LM_BUG("invalid db type/n");					return 1;			}check_ret:			if (ret != SQLITE_OK) {				return ret;			}		}	}	return SQLITE_OK;}
开发者ID:AndreiPlesa,项目名称:opensips,代码行数:56,


示例15: bind

 void bind(statement s,int idx,double &val) {     /** @brief bind argument with a double */     int rc=sqlite3_bind_double(s,idx,val);     if (rc) {         DBError::busy_aware_throw(rc,sqlite3_errmsg(db));     }     LOCK_COUT     cout << "[DB] " << s << ": " << "?" << idx << " = " << val << endl;     UNLOCK_COUT }
开发者ID:gau-veldt,项目名称:Minetest-Blockiverse,代码行数:10,


示例16: checkVM

void CppSQLite3Statement::bind(int nParam, const double dValue){	checkVM();	int nRes = sqlite3_bind_double(mpVM, nParam, dValue);	if (nRes != SQLITE_OK)	{		IwError(("Error binding double param"));	}}
开发者ID:dongfangx,项目名称:sqlite,代码行数:10,


示例17: checkErr

void PlaceDatabase::findInRegion(cv::Rect_<double> bounding_box, std::vector<int64_t>& ids) const{  // Bind bounding box in the map to the query  checkErr(sqlite3_bind_double(select_spatial_stmt_, 1, bounding_box.x), "Bind error");  checkErr(sqlite3_bind_double(select_spatial_stmt_, 2, bounding_box.x + bounding_box.width), "Bind error");  checkErr(sqlite3_bind_double(select_spatial_stmt_, 3, bounding_box.y), "Bind error");  checkErr(sqlite3_bind_double(select_spatial_stmt_, 4, bounding_box.y + bounding_box.height), "Bind error");  ids.clear();  int err;  while ((err = sqlite3_step(select_spatial_stmt_)) == SQLITE_ROW)    ids.push_back( sqlite3_column_int(select_spatial_stmt_, 0) );    checkErr(err, "Error executing spatial query", SQLITE_DONE);  // Reset prepared statement to reuse on next call  checkErr(sqlite3_reset(select_spatial_stmt_), "Couldn't reset SELECT spatial statement");  checkErr(sqlite3_clear_bindings(select_spatial_stmt_), "Couldn't clear bindings on SELECT spatial statment");}
开发者ID:koenlek,项目名称:topological_navigation_fuerte,代码行数:19,


示例18: ephy_sqlite_statement_bind_double

gbooleanephy_sqlite_statement_bind_double (EphySQLiteStatement *self, int column, double value, GError **error){  if (sqlite3_bind_double (self->priv->prepared_statement, column + 1, value) != SQLITE_OK) {    ephy_sqlite_connection_get_error (self->priv->connection, error);    return FALSE;  }  return TRUE;}
开发者ID:dreamsxin,项目名称:epiphany,代码行数:10,


示例19: nativeBindDouble

static void nativeBindDouble(JNIEnv* env, jclass clazz, jlong connectionPtr,        jlong statementPtr, jint index, jdouble value) {    SQLiteConnection* connection = reinterpret_cast<SQLiteConnection*>(connectionPtr);    sqlite3_stmt* statement = reinterpret_cast<sqlite3_stmt*>(statementPtr);    int err = sqlite3_bind_double(statement, index, value);    if (err != SQLITE_OK) {        throw_sqlite3_exception(env, connection->db, NULL);    }}
开发者ID:yuzhiyun,项目名称:platform_frameworks_base,代码行数:10,


示例20: checkVM

void CppSQLite3Statement::bind(int nParam, const double dValue){	checkVM();	int nRes = sqlite3_bind_double(mpVM, nParam, dValue);	if (nRes != SQLITE_OK)	{		throw CppSQLite3Exception(nRes,"Error binding double param",DONT_DELETE_MSG);	}}
开发者ID:bblr001,项目名称:MVS,代码行数:10,


示例21: StoreAITable

int StoreAITable(sqlite3 *db, unsigned long int sid, FILE *fp, int swp){    int retval = 0;    int rc;    sqlite3_stmt *stmt;        char *sql;    sql = "INSERT INTO aitransitions" /          " (sid, ini_id, fin_id, rate)" /          " VALUES (?, ?, ?, ?)";        sqlite3_prepare_v2(db, sql, -1, &stmt, NULL);    sqlite3_bind_int(stmt,  1, sid);        sqlite3_exec(db, "BEGIN", 0, 0, 0);    while (retval == 0) {        AI_HEADER h;        int n, i;        n = ReadAIHeader(fp, &h, swp);        if (n == 0) {            break;        }        for (i = 0; i < h.ntransitions; i++) {            AI_RECORD r;                        n = ReadAIRecord(fp, &r, swp);            if (n == 0) {                break;            }                        sqlite3_bind_int   (stmt,  2, r.b);            sqlite3_bind_int   (stmt,  3, r.f);            sqlite3_bind_double(stmt,  4, r.rate);            rc = sqlite3_step(stmt);            if (rc != SQLITE_DONE) {                fprintf(stderr, "SQL error: %s/n", sqlite3_errmsg(db));                retval = -1;                break;            }            sqlite3_reset(stmt);        }    }    sqlite3_exec(db, "COMMIT", 0, 0, 0);    sqlite3_finalize(stmt);    return retval;}
开发者ID:mathboylinlin,项目名称:cfac,代码行数:55,


示例22: sqlite3_bind_double_c_

int FTNCALL sqlite3_bind_double_c_(       sqlite3_stmt **stmt,       int           *colidx,       double        *value      ){   int   rc   ;   rc = sqlite3_bind_double(*stmt, *colidx, *value ) ;   return rc ;}
开发者ID:ajarbancina,项目名称:swat-eclipse,代码行数:11,


示例23: sqlite3_bind_null

void Lite3Query::bindDouble(int no, double *data, int *null){  if (stmt == 0) prepare();  int rc;  if (null != 0 && *null != 0)    rc = sqlite3_bind_null(stmt, no);  else    rc = sqlite3_bind_double(stmt, no, *data);  if (rc != SQLITE_OK)    throw Lite3Exception(rc, "Bind of double failed", LITE3_MARK);}
开发者ID:VincentRisi,项目名称:jportal,代码行数:11,


示例24: FindParameterIndex

DB_Error SqliteCommand::Bind(const char* name, double data){    DB_Error ret = DB_INVAL;    int index = FindParameterIndex(name);    if (index)    {        ret = sqlite3_bind_double(m_stmt, index, data);    }    return ret;}
开发者ID:yangyingchao,项目名称:TeleHealth,代码行数:11,


示例25: checkVM

void CSQLite3Statement::bindFloat(const int iField, const double dValue){    checkVM();    CheckParam(iField);    int iRtn = sqlite3_bind_double(m_pVM, iField + 1, dValue);    if (iRtn != SQLITE_OK)    {        Q_EXCEPTION(sqlite3_errcode(m_pDB), "%s", sqlite3_errmsg(m_pDB));    }}
开发者ID:867344633,项目名称:QService,代码行数:11,


示例26: vknn_rect_distance

static doublevknn_rect_distance (VKnnContextPtr ctx, double minx, double miny, double maxx,		    double maxy){/* computing the distance between the geometry and an R*Tree MBR */    double dist = DBL_MAX;    int ret;    sqlite3_stmt *stmt;    if (ctx == NULL)	return DBL_MAX;    if (ctx->blob == NULL)	return DBL_MAX;    if (ctx->stmt_rect == NULL)	return DBL_MAX;    stmt = ctx->stmt_rect;    sqlite3_reset (stmt);    sqlite3_clear_bindings (stmt);    sqlite3_bind_blob (stmt, 1, ctx->blob, ctx->blob_size, SQLITE_STATIC);    sqlite3_bind_double (stmt, 2, minx);    sqlite3_bind_double (stmt, 3, miny);    sqlite3_bind_double (stmt, 4, maxx);    sqlite3_bind_double (stmt, 5, maxy);    while (1)      {	  /* scrolling the result set rows */	  ret = sqlite3_step (stmt);	  if (ret == SQLITE_DONE)	      break;		/* end of result set */	  if (ret == SQLITE_ROW)	    {		if (sqlite3_column_type (stmt, 0) == SQLITE_FLOAT)		    dist = sqlite3_column_double (stmt, 0);	    }	  else	    {		dist = DBL_MAX;		break;	    }      }    return dist;}
开发者ID:ryandavid,项目名称:rotobox,代码行数:41,


示例27:

bool DB::Bindings::bindDouble(int index, double value){	if (!isValid()) {		DB::logError("Bindings::bindDouble: statement is not valid");		return false;	}	if (sqlite3_bind_double(_handle->_stmt, index, value) != SQLITE_OK) {		reportError(_handle->_stmt);		return false;	}	return true;}
开发者ID:GarysRefererence2014,项目名称:SoftHSMv2,代码行数:12,


示例28: return

bool SqQuery::BindParamFloat(unsigned int param, float f){	/* SQLite is 1 indexed */	param++;	if (param > m_ParamCount)	{		return false;	}	return (sqlite3_bind_double(m_pStmt, param, (double)f) == SQLITE_OK);}
开发者ID:Nephyrin,项目名称:-furry-octo-nemesis,代码行数:12,


示例29: switch

	void SQLiteQuery::BindValue(int index, const SQLiteValue& value)	{		if (!stmt) throw SQLiteError(SQL_ERRCODE_NO_INIT);		if (!index) throw SQLiteError(SQL_ERRCODE_NO_PARAM);		int result = 0;		switch (value.type)		{		case TYPE_STRING:			{				ObjString& str = (ObjString&)*value.object;				result = sqlite3_bind_text(stmt, index, str.GetValue(),					-1, SQLITE_TRANSIENT);			} break;					case TYPE_WSTRING:			{				ObjWString& str = (ObjWString&)*value.object;				result = sqlite3_bind_text16(stmt, index, str.GetValue(),					-1, SQLITE_TRANSIENT);			} break;		case TYPE_INT:			{				ObjNumber& num = (ObjNumber&)value.object;				result = sqlite3_bind_int(stmt, index, (int)num.GetValue());			}break;		case TYPE_DOUBLE:			{				ObjNumber& num = (ObjNumber&)value.object;				result = sqlite3_bind_double(stmt, index, num.GetValue());			}break;		case TYPE_BLOB:			{				ObjBlob& blob = (ObjBlob&)value.object;				size_t length;				BYTE* data = blob.GetData(length);				result = sqlite3_bind_blob(stmt, index, data, length,					SQLITE_TRANSIENT);			}break;		}		// Handle any errors		switch (result)		{		case SQLITE_OK:			break;		default:			throw SQLiteError(parent.LastError());			break;		}		}
开发者ID:twhitcomb,项目名称:Phasor,代码行数:53,



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


C++ sqlite3_bind_int函数代码示例
C++ sqlite3VdbeResolveLabel函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。