// The cmd string direct output to result
// Execute the command, then open result and read
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
void main() {
FILE *f;
char buff[100];
const char * query = "select 'hello Sqlite3';";
const char * cmd = "sqlite3  test.db  < name > result";
f = fopen("name", "w+");
if(f==0) exit(1);
fwrite(query, strlen(query), 1, f);
fclose(f);
f = fopen("result", "r");
if(f==0) exit(2);
system(cmd);
while (fgets(buff, sizeof(buff)-1, f) != NULL)
printf("%s", buff);
fclose(f);
exit(0);
}
On Sun, Jan 29, 2012 at 4:08 PM, Chris Peachment <ch...@ononbb.com> wrote:

> The select statement needs an 's' on 'motorcycle'
> to match the table definition. Or you can remove
> the 's' in the create statement.
>
> On Sun, 2012-01-29 at 20:03 -0400, Chris Peachment wrote:
> >     SqlText = "select description from motorcycle "
> >               " where model like :model";
> >
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to