An Error Occurred Parsing The Provided Sql Statement
lot of out-dated information so use with care. Also see our new Developer Portal for more ways to get help. An error occured parsing the provided SQL Statement ANSWERED ANSWERS: 2 VOTES: 1 I’m having trouble inserting records into my sqlite database.This is how I create the database: var db = Ti.Database.open('mydb'); db.execute('create table if not exists favorieten2 (pk integer primary key autoincrement, artikel_id integer null, artikel_titel text null, artikel_tekst text null, artikel_foto text null)'); And this is the query I’m trying to execute: insert into favorieten2(artikel_id, artikel_titel, artikel_tekst, artikel_foto) values (134,'Laatste campagnedag in Frankrijk ','Vandaag is het de laatste dag voor de beslissende ronde in de Franse presidentsverkiezingen. De socialist Fran\U00e7ois Hollande beschikt nog altijd over de beste papieren: op dit moment heeft hij zo''n 5 procent voorsprong op Nicolas Sarkozy. Gisteren was de allerlaatste campagnedag. Beide kandidaten zijn tot op de laatste minuut blijven vechten voor elke stem.','img/fotos-artikels/Schermafbeelding 2012-05-15 om 18.54.03.png') Which is generated and executed by this function function insertFavorite(id, title, text, image) { var sql = "insert into favorieten2(artikel_id, artikel_titel, artikel_tekst, artikel_foto) values ("; sql += "" + id + ","; sql += here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more https://archive.appcelerator.com/question/139562/an-error-occured-parsing-the-provided-sql-statement about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping http://stackoverflow.com/questions/8585900/in-appcelerator-titanium-sql-left-join-is-not-working each other. Join them; it only takes a minute: Sign up in appcelerator titanium sql left join is not working up vote 1 down vote favorite i'm working on APPCELERATOR TITANIUM. i'm using a database in which strangely some sql queries are not working properly like this for instance: db.execute("SELECT Location_Diners.Dining_Time,Location_Diners.First_Name,Location_Diners.Last_Name,Location_Diners.PartySize,Location_Diners.Diner_ID,Location_Diners.DinerStatusColor_ID,Location_Diners.Notes,Location_Diners.Diner_ID,Location_SeatedDiners.Table_ID FROM Location_Diners LEFT JOIN Location_SeatedDiners ON Location_Diners.Diner_ID=Location_SeatedDiners.Diner_ID"); this is the error i'm getting please help me out here..... 2011-12-21 11:47:29.416 abc[5254:ac03] [ERROR] A SQLite database error occurred on database '/Users/../iPhone Simulator/4.3.2/Applications/C377123C-7A2A-4FDF-9314-428713C885FD/Library/Application Support/database.sql': Error Domain=com.plausiblelabs.pldatabase Code=3 "An error occured parsing the provided SQL statement." UserInfo=0x6ad4330 {com.plausiblelabs.pldatabase.error.vendor.code=1, NSLocalizedDescription=An error occured parsing the provided SQL statement., com.plausiblelabs.pldatabase.error.query.string=SELECT Location_Diners.Dining_Time,Location_Diners.First_Name,Location_Diners.Last_Name,Location_Diners.PartySize,Location_Diners.Diner_ID,Location_Diners.DinerStatusColor_ID,Location_Diners.Notes,Location_Diners.Diner_ID,Location_SeatedDiners.Table_ID FROM Location_Diners LEFT JOIN Location_SeatedDiners ON Location_Diners.Diner_ID=Location_SeatedDiners.Diner_ID, com.pl here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this http://stackoverflow.com/questions/37879231/titanium-model-collecitn-error site About Us Learn more about Stack Overflow the company Business Learn http://www.alphasoftware.com/alphaforum/showthread.php?91063-Error-parsing-SQL-statement-Your-database-has-returned-the-following-error-code-and more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Titanium an error model / collecitn error up vote 0 down vote favorite I want to fetch datas from a model that i created, below is the code is save model : var test = { competence_principale : 'F', competence_secondaire : 'B', date_debut : 'dd', date_fin : 'df', entreprise : 'ent', poste_occupe : 'po' }; var competencesModel = Alloy.createModel('competences', test); competencesModel.save(); var collection = Alloy.createCollection("competences"); collection.fetch({ success an error occurred : function() { _.each(collection.models, function(element, index, list) { Ti.API.info(element); }); }, error : function(e) { Ti.API.error(e); } }); This is the model adater : exports.definition = { config: { columns: { "id_competence": "INTEGER PRIMARY KEY AUTOINCREMENT", "poste_occupe": "TEXT", "entreprise": "TEXT", "date_debut": "TEXT", "date_fin": "TEXT", "competence_principale": "TEXT", "competence_secondaire": "TEXT", }, adapter: { type: "sql", collection_name: "competences", idAttribute: "id_competence", } }, extendModel: function(Model) { _.extend(Model.prototype, { // extended functions and properties go here }); return Model; }, extendCollection: function(Collection) { _.extend(Collection.prototype, { // extended functions and properties go here // For Backbone v1.1.2, uncomment the following to override the // fetch method to account for a breaking change in Backbone. /* fetch: function(options) { options = options ? _.clone(options) : {}; options.reset = true; return Backbone.Collection.prototype.fetch.call(this, options); } */ }); return Collection; } }; I got following error : [WARN] : 2016-06-17 12:21:14.534 myMobile[22102:142633] [ERROR] A SQLite database error occurred on database [ERROR] : Script Error { [ERROR] : column = 23; [ERROR] : line = 133; [ERROR] : message = "invalid SQL statement"; [ERROR] : nativeLocation = "-[TiDatabaseProxy execute:] (TiDatabaseProxy.m:196)"; [ERROR] : nativeReason = "Error Domain=com.plausiblelabs.pldatabase Code=3 \"An error Error parsing SQL statement Your database has returned the following error code and If this is your first visit, be sure to check out the FAQ by clicking the link above. You must register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 10 of 10 Thread: Error parsing SQL statement Your database has returned the following error code and Thread Tools Show Printable Version 12-20-2010,10:22 AM #1 aburningflame View Profile View Forum Posts Private Message Member Real NameScott Join Date Mar 2010 Location Toronto,ON Posts 968 Error parsing SQL statement Your database has returned the following error code and Error parsing SQL statement Your database has returned the following error code and description to Alpha Five. Consult your database documentation for further information. 91 - 'line 1:44: unexpected token: date_sub' UPDATE co_grouporders_list SET cutoff_date=date_sub(delivery_date, INTERVAL :noticeTimeMin MINUTE), approval_date=delivery_date-INTERVAL :approvalTimeMin MINUTE WHERE grpord_id=:grpOrdId AND fn_GetOrderCountForGroupOrderId(:grpOrdId)=0 AND (SELECT stop FROM co_grouporders WHERE id=:grpOrdId)=1;UPDATE co_grouporders_list SET cutoff_date=date_sub(delivery_date, INTERVAL :noticeTimeMin MINUTE), approval_date=NULL WHERE grpord_id=:grpOrdId AND fn_GetOrderCountForGroupOrderId(:grpOrdId)=0 AND (SELECT stop FROM co_grouporders WHERE id=:grpOrdId)=0; This is SO misleading. My database did NOT return this error - Alpha's parser did. This statement doesn't even hit the database - as Alpha decided it wasn't valid. Because apparently I can't use date_sub(). Is there something I'm missing here? Calling a function in an insert is not allowed or something? Reply With Quote 12-20-2010,10:28 AM #2 aburningflame View Profile View Forum Posts Private Message Member Real NameScott Join Date Mar 2010 Location Toronto,ON Posts 968 Re: Error parsing SQL statement Your database has returned the following error code UPDATE co_grouporders_list SET cutoff_date=date_sub(delivery_date, INTERVAL 20 MINUTE), approval_date=delivery_date-INTERVAL 20 MINUTE WHERE grpord_id=55 AND fn_GetOrderCountForGroupOrderId(55)=0 AND (SELECT stop FROM co_grouporders WHERE id=55)=1; UPDATE co_grouporders_list SET cutoff_date=date_sub(delivery_date, INTERVAL 20 MINUTE), approva