Hi all,

I am new to Sqlite.Please see the below code.

 static const char *selectCmd = "SELECT * FROM cert_store_table where
certNumber = :certNumber;" ;
 static const char *cmd = "CREATE TABLE cert_store_table ( certNumber
INTEGER primary key , certTypeLen INTEGER , certType  TEXT , validFlag TEXT,
certData BLOB)";


returnCode = sqlite3_open(CertStoreDatabaseName,&dbHandle);
  if( returnCode != SQLITE_OK )
  {
      printf("Can't open database: %s\n", sqlite3_errmsg(dbHandle));
      sqlite3_close(dbHandle);
  }

  returnCode = sqlite3_exec(dbHandle, cmd, NULL, NULL, NULL);
  if( returnCode!=SQLITE_OK )
  {
      printf("Can't exec cmd in database: %s\n", sqlite3_errmsg(dbHandle));
      sqlite3_close(dbHandle);
  }


returnCode = sqlite3_prepare(dbHandle, selectCmd, strlen(selectCmd), &stmt,
&tail);
  if( returnCode!=SQLITE_OK )
  {
      printf("Can't prepare select cmd in database: %s\n",
sqlite3_errmsg(dbHandle));
      sqlite3_close(dbHandle);
  }


  sqlite3_bind_int(stmt,  1, 10);

        returnCode = sqlite3_step(stmt);
        printf("DEBUG : %d\n",returnCode);



In the above code i didn't added any records in the database.Just i asked to
return the record whose
CertNumber is 10 which was not found.I hope that the return code will be

SQLITE_NOTFOUND but i am getting  SQLITE_DONE ?

Why is this happening ...........

Thanks in advance,

Waiting for your reply,
Aravind.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to