syahmicro Posted March 11, 2013 Share Posted March 11, 2013 i had some problems with sqlite while i create tbl.beside that,can we modify existing programs to reduce this problem sqlite> create table tbl1(one varchar(10), two smallint);sqlite> insert into tbl1 values('hello!',10);sqlite> insert into tbl1 values('goodbye', 20);sqlite> insert into tbl1 values('hello maye, 30); ...> insert into tbl1 values('hello maye', 30); ...> ; ...> ; ...> ' ...> ' ...> ; ...> ; ...> ; ...> ' ...> ;Error: near "hello": syntax errorsqlite> is it true? [CODE]/* Run commands received from standard input */ if( stdin_is_interactive ){ char *zHome; char *zHistory = 0; int nHistory; printf( "SQLite version %s %.19s\n" /*extra-version-info*/ "Enter \".help\" for instructions\n" "Enter SQL statements terminated with a \";\"\n", sqlite3_libversion(), sqlite3_sourceid() ); zHome = find_home_dir(); if( zHome ){ nHistory = strlen30(zHome) + 20; if( (zHistory = malloc(nHistory))!=0 ){ sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome); } }#if defined(HAVE_READLINE) && HAVE_READLINE==1 if( zHistory ) read_history(zHistory);#endif rc = process_input(&data, 0); if( zHistory ){ stifle_history(100); write_history(zHistory); free(zHistory); } }else{ rc = process_input(&data, stdin); } } set_table_name(&data, 0); if( data.db ){ sqlite3_close(data.db); } return rc;} 1 Link to comment Share on other sites More sharing options...
justsomeguy Posted March 11, 2013 Share Posted March 11, 2013 You are missing a quote in your 3rd insert query. Link to comment Share on other sites More sharing options...
syahmicro Posted March 12, 2013 Author Share Posted March 12, 2013 yeah i know that,but I have a problem to change the coding in the shell file which shell.c it is run using gcc compiler,thus i curious if it can be modify the coding there for enhance this type of problem Link to comment Share on other sites More sharing options...
justsomeguy Posted March 12, 2013 Share Posted March 12, 2013 I'm not really sure what you're asking. You can modify C code and recompile it. You can use C to parse and validate SQL queries if you want to write a parser to do that or find one that someone else wrote. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now