草庐IT

alter_column

全部标签

iphone - 在 sqlite3_column_text 中使用列名而不是数字

有什么方法可以使用列名而不是int作为列号:(char*)sqlite3_column_text(statement,1)这就是我现在做的:sqlite3*db=[MyAppDelegategetNewDBConnection];sqlite3_stmt*statement=nil;constchar*sql="select*fromfoofjoinbarbonb.id=f.id;";if(sqlite3_prepare_v2(db,sql,-1,&statement,NULL)!=SQLITE_OK)NSAssert1(0,@"Errorpreparingstatement%s",s

sql - SQLite INNER JOIN 中的 "ambiguous column name"

我在SQLite数据库中有两个表,INVITEM和SHOPITEM。他们的共享属性是ItemId,我想执行INNERJOIN。这是查询:SELECTINVITEM.CharIdASCharId,INVITEM.ItemIdASItemIdFROM(INVITEMasINVITEMINNERJOINSHOPITEMASSHOPITEMONSHOPITEM.ItemId=INVITEM.ItemId)WHEREItemId=3;SQLite不喜欢它:SQLerror:ambiguouscolumnname:ItemId如果我编写WHEREINVITEM.ItemId=3,错误就会消失,但由

安卓。 SQLite 异常 : no such column _id

我在尝试获取存储在我的数据库中的信息并将其显示在ListView中时遇到了一些麻烦。这是我要显示行的ListActivity:publicclassPruebaextendsListActivity{/**Calledwhentheactivityisfirstcreated.*/@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.i_prueba);DataBaseAccessdb=newDataBaseAcce

android.database.sqlite.SQLiteException : table X has no column named Y: , 编译时:INSERT INTO

这是我在控制台中的错误:11-2919:06:50.295:E/AndroidRuntime(333):android.database.sqlite.SQLiteException:tableusuarioshasnocolumnnamedemail:,whilecompiling:INSERTINTOusuarios(username,organizacion,email)VALUES(?,?,?);这是mainActivity,带有一个用于创建“Perfil”(用户)[btCrearPerfil]的Activity的按钮......以及一个用于查看listView的按钮[btEd

java - android.database.sqlite.SQLiteException : no such column

当我执行这个查询时,我得到“android.database.sqlite.SQLiteException:nosuchcolumn”错误是什么?publicCursorGetupdate(Stringrid)throwsSQLException{Cursorm1Cursor=db.rawQuery("SELECT_idFROMMeetingwheremeet="+rid,null);if(m1Cursor!=null){if(m1Cursor.getCount()>0){m1Cursor.moveToFirst();}}returnm1Cursor;}日志05-2801:22:27.

android - (1) "AUTO_INCREMENT"附近 : syntax error when altering table

我正在尝试更改定义如下的SQLite表:StringCREATE_TABLE="CREATETABLEIFNOTEXISTS"+tab_NAME+"("+row_ID+"INTEGERPRIMARYKEY,"+row_NAME+"TEXT,"+row_EMAIL+"TEXT,"+row_WEBSITE+"TEXT,"+row_TELEPHONE1+"TEXT,"+row_TELEPHONE2+"TEXT,"+row_TELEPHONE3+"TEXT,"+row_TELEPHONE4+"TEXT,"+row_TELEPHONE5+"TEXT);";db_name.execSQL(CREA

sqlite3 : creating table with no columns

我想在sqlite3中创建没有列的表。在postgres数据库中是可能的,但在sqlite3数据库中是不可能的。有什么方法可以实现这一点,或者它根本不受支持(可能不在sql标准中?)我已经检查了sqlite3CREATETABLE语法,看来,必须至少有一个列,但是也许我错过了什么? 最佳答案 SQLite不支持零列表。或者在SQL标准中。 关于sqlite3:creatingtablewithnocolumns,我们在StackOverflow上找到一个类似的问题:

安卓 SQLite 错误 "requesting column name with table name"

运行以下形式的sql查询后:SELECTtable_name.column_nameFROMtable_name,table_name2,etc...WHEREcondition1,condition2,etc...,我收到以下错误,但不会关闭我的程序:requestingcolumnnamewithtablename--table_name.column_name谷歌搜索这个错误短语让我找到了android.database.sqlite.SQLiteCursorline314在第314行上方的几行有一条注释,说这段代码是对bug903852的响应。但我似乎无法在google上找到这

SQLite 插入问题 – 错误 : no such column

我遇到了SQLite的问题(如果重要,版本3.7.13)。我创建了一个包含两列foo和bar的新表,数据类型未定义。当我尝试插入数字时,它工作正常。当我插入文本时,“错误:没有这样的列”发生了。sqlite>CREATETABLEtest(foo,bar);sqlite>.tablestestsqlite>insertintotestvalues(0,1);sqlite>select*fromtest;0|1sqlite>insertintotestvalues(a,b);Error:nosuchcolumn:a我做错了什么?谢谢。 最佳答案

sqlite - 使用 SQLite 'Cannot add a NOT NULL column with default value NULL' 进行 Laravel 迁移

为什么我在使用SQLite驱动程序时收到此警告?我对MySQL驱动程序没有任何问题,但SQLite会抛出此错误。这对我来说没有意义,因为我知道播种发生在所有迁移完成之后,所以为什么它会提示这个问题,这个问题只有在数据已经存在于数据库中时才会出现。我的两次迁移是第一次迁移publicfunctionup(){Schema::create('users',function($table){$table->increments('id');$table->string('username');$table->string('email');$table->string('password')