Re: [sqlite] Basic insert statement - syntax problem
Asko Kauppi wrote: Still, shouldn't the 'mri_output' (table name) be quoted? 17.2.2005 kello 11:45, Anirban Sarkar kirjoitti: I am really very sorry. I mistyped the entire sql statement. This is what my actual code looks like: sqlite db1 "cesc_simputer.db" #Inserting data into mri_output table set connection_no { } set insert_normal "insert into mri_output (pwd,ac_my,con_no) values ('$pass','$ac_mth$ac_yr','$sel_con')" db1 eval insert_normal {} { } Table names (and column names) only need to be quoted when they may conflict with keywords in the sql language. Googling, I found: Before the SQL-92 standard, it was not legal to have object names (identifiers) in a database that duplicated keywords in the language, were case-sensitive or contained spaces. SQL-92 introduced a single new standard to make any of them legal, provided that the identifiers were defined within pairs of double-quote symbols and were always referred to using double-quote delimiters. So while sqlite would understand 'mri_output', it is not necessary, and it would be preferred to use double quotes:"mri_output" John LeSueur
Re: [sqlite] Basic insert statement - syntax problem
On Thu, 17 Feb 2005, Anirban Sarkar wrote: >I am really very sorry. >I mistyped the entire sql statement. >This is what my actual code looks like: > >sqlite db1 "cesc_simputer.db" > >#Inserting data into mri_output table > set connection_no { } > set insert_normal "insert into mri_output (pwd,ac_my,con_no) values > ('$pass','$ac_mth$ac_yr','$sel_con')" > db1 eval insert_normal {} { > > } > >Please note that the problem is with the syntax of the sql statement. What is the syntax error message? Do any of the substituted values contain apostrophe "'" characters? > >Regards, >Anirban Sarkar > >- Original Message - >From: "Asko Kauppi" <[EMAIL PROTECTED]> >To: <sqlite-users@sqlite.org> >Sent: Thursday, February 17, 2005 2:46 PM >Subject: Re: [sqlite] Basic insert statement - syntax problem > > >> >> The error messages provided by SQLite seem to be very helpful, can you >> use them? >> >> like: if (rc) glua_errorN( "sqlite3 error %d: %s", rc, >> sqlite3_errmsg(db) ); >> >> Aside that, shouldn't the table name (mri) have quotes ('mri')? >> What's the $con_no doing without quotes as well. Use ?1 for binding >> stuff if that's what you need. >> >> -ak >> >> >> 17.2.2005 kello 11:04, Anirban Sarkar kirjoitti: >> >> Hi all, >> > >> > I am having syntax problem with a basic sqlite insert statement. I >> > know it's very simple but just could'nt make out where I am going >> > wrong. >> > >> > set insert_details "insert into mri (pwd,con_no) values >> > ('$pwd',$con_no)" >> > Where am I going wrong? >> > >> > Thanks and regards, >> > Anirban Sarkar >> -- /"\ \ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL X - AGAINST MS ATTACHMENTS / \
Re: Re: [sqlite] Basic insert statement - syntax problem
Thanks Lawrence, once again. Regards, Anirban - Original Message - From: <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Thursday, February 17, 2005 3:46 PM Subject: Re: Re: [sqlite] Basic insert statement - syntax problem > > > > > From: "Anirban Sarkar" <[EMAIL PROTECTED]> > > Date: 2005/02/17 Thu AM 09:45:03 GMT > > To: <sqlite-users@sqlite.org> > > Subject: Re: [sqlite] Basic insert statement - syntax problem > > > > #Inserting data into mri_output table > > set connection_no { } > > set insert_normal "insert into mri_output (pwd,ac_my,con_no) values ('$pass','$ac_mth$ac_yr','$sel_con')" > > db1 eval insert_normal {} { > > > > } > > Unless you mistyped agains, then the las line above should be > > db1 eval $insert_normal {} { > .^ missing in original > > Lawrence > > > - > Email sent from www.ntlworld.com > virus-checked by McAfee > visit www.ntlworld.com/security for more information > >
Re: [sqlite] Basic insert statement - syntax problem
Still, shouldn't the 'mri_output' (table name) be quoted? 17.2.2005 kello 11:45, Anirban Sarkar kirjoitti: I am really very sorry. I mistyped the entire sql statement. This is what my actual code looks like: sqlite db1 "cesc_simputer.db" #Inserting data into mri_output table set connection_no { } set insert_normal "insert into mri_output (pwd,ac_my,con_no) values ('$pass','$ac_mth$ac_yr','$sel_con')" db1 eval insert_normal {} { } Please note that the problem is with the syntax of the sql statement. Regards, Anirban Sarkar - Original Message - From: "Asko Kauppi" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Thursday, February 17, 2005 2:46 PM Subject: Re: [sqlite] Basic insert statement - syntax problem The error messages provided by SQLite seem to be very helpful, can you use them? like: if (rc) glua_errorN( "sqlite3 error %d: %s", rc, sqlite3_errmsg(db) ); Aside that, shouldn't the table name (mri) have quotes ('mri')? What's the $con_no doing without quotes as well. Use ?1 for binding stuff if that's what you need. -ak 17.2.2005 kello 11:04, Anirban Sarkar kirjoitti: Hi all, I am having syntax problem with a basic sqlite insert statement. I know it's very simple but just could'nt make out where I am going wrong. set insert_details "insert into mri (pwd,con_no) values ('$pwd',$con_no)" Where am I going wrong? Thanks and regards, Anirban Sarkar
Re: Re: [sqlite] Basic insert statement - syntax problem
> > From: "Anirban Sarkar" <[EMAIL PROTECTED]> > Date: 2005/02/17 Thu AM 09:45:03 GMT > To: <sqlite-users@sqlite.org> > Subject: Re: [sqlite] Basic insert statement - syntax problem > > #Inserting data into mri_output table > set connection_no { } > set insert_normal "insert into mri_output (pwd,ac_my,con_no) values > ('$pass','$ac_mth$ac_yr','$sel_con')" > db1 eval insert_normal {} { > > } Unless you mistyped agains, then the las line above should be db1 eval $insert_normal {} { .^ missing in original Lawrence - Email sent from www.ntlworld.com virus-checked by McAfee visit www.ntlworld.com/security for more information
Re: [sqlite] Basic insert statement - syntax problem
I am really very sorry. I mistyped the entire sql statement. This is what my actual code looks like: sqlite db1 "cesc_simputer.db" #Inserting data into mri_output table set connection_no { } set insert_normal "insert into mri_output (pwd,ac_my,con_no) values ('$pass','$ac_mth$ac_yr','$sel_con')" db1 eval insert_normal {} { } Please note that the problem is with the syntax of the sql statement. Regards, Anirban Sarkar - Original Message - From: "Asko Kauppi" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Thursday, February 17, 2005 2:46 PM Subject: Re: [sqlite] Basic insert statement - syntax problem > > The error messages provided by SQLite seem to be very helpful, can you > use them? > > like: if (rc) glua_errorN( "sqlite3 error %d: %s", rc, > sqlite3_errmsg(db) ); > > Aside that, shouldn't the table name (mri) have quotes ('mri')? > What's the $con_no doing without quotes as well. Use ?1 for binding > stuff if that's what you need. > > -ak > > > 17.2.2005 kello 11:04, Anirban Sarkar kirjoitti: > > Hi all, > > > > I am having syntax problem with a basic sqlite insert statement. I > > know it's very simple but just could'nt make out where I am going > > wrong. > > > > set insert_details "insert into mri (pwd,con_no) values > > ('$pwd',$con_no)" > > Where am I going wrong? > > > > Thanks and regards, > > Anirban Sarkar >
Re: [sqlite] Basic insert statement - syntax problem
The error messages provided by SQLite seem to be very helpful, can you use them? like: if (rc) glua_errorN( "sqlite3 error %d: %s", rc, sqlite3_errmsg(db) ); Aside that, shouldn't the table name (mri) have quotes ('mri')? What's the $con_no doing without quotes as well. Use ?1 for binding stuff if that's what you need. -ak 17.2.2005 kello 11:04, Anirban Sarkar kirjoitti: Hi all, I am having syntax problem with a basic sqlite insert statement. I know it's very simple but just could'nt make out where I am going wrong. set insert_details "insert into mri (pwd,con_no) values ('$pwd',$con_no)" Where am I going wrong? Thanks and regards, Anirban Sarkar
[sqlite] Basic insert statement - syntax problem
Hi all, I am having syntax problem with a basic sqlite insert statement. I know it's very simple but just could'nt make out where I am going wrong. set insert_details "insert into mri (pwd,con_no) values ('$pwd',$con_no)" Where am I going wrong? Thanks and regards, Anirban Sarkar