Hi
the sqlite3_exec is called from the following code snippet.

get_entries_fromdatabase ()
{

  sqlite3 *db;
  char *zErrMsg = 0;
  int rc;

 char database_buffer[BUFSIZ];

  rc = sqlite3_open (database_buffer, &db);
  if (rc)
    {
      fprintf (stderr, "Can't open database: %s\n", sqlite3_errmsg (db));
      sqlite3_close (db);
      return -1;
    }
  rc = sqlite3_exec (db, command, (void  * )callback, 0, &zErrMsg);
  if (rc != SQLITE_OK)
    {
      fprintf (stderr, "SQL error: %s\n", zErrMsg);
      sqlite3_free (zErrMsg);
      return -1;
    }
  sqlite3_close (db);
}

where command is
"select name_1, phones, unit_no, place_name_1, block_1, streetname_1,
x_addr, y_addr, logo_1, bitmap_1, bluetooth_file  from  DirectoryService
where (x_addr >=23800.000000) AND (x_addr <=27800.000000) AND (y_addr
>=28000.000000) AND (y_addr <=32000.000000) AND main_category='Hotel' AND
sub_category='4Star' order by name_1  "

The same code works fine on x86 ,and the given select command gives correct
result on  as on  ARM command line prompt.

The callback function is

static int
callback (void *NotUsed, void *NOTUsed, char *ch_strings_p2[COLUMN],
      char *ch_ColName_p2[COLUMN])
{
 unsigned int U32_i;
  unsigned long int sz;
  char *ptr;
  // gU32_count=0;

  for (U32_i = 0; U32_i < ENTRIES; U32_i++)
    {
#ifdef DEBUG
      printf ("%s= %s\n", ch_ColName_p2[U32_i],
          ch_strings_p2[U32_i] ? ch_strings_p2[U32_i] : "NULL");
#endif
      if (ch_strings_p2[U32_i] == NULL)
    ch_strings_p2[U32_i] = "NA";

      ptr = (char *) malloc (strlen (ch_strings_p2[U32_i]) + 1);
      strcpy (ptr, ch_strings_p2[U32_i]);
      gch_name_p2[gU32_index] = malloc (strlen (ptr) + 1);
      strcpy (gch_name_p2[gU32_index], ptr);
      gU32_index++;
      free (ptr);
    }
  gU32_count++;
  return 0;

 }


Tried replacing the callback function with a simple function contaings just
some printfs . Yet the same error





On Tue, Sep 8, 2009 at 11:47 AM, Atul_Vaidya <
[email protected]> wrote:

>
>
> Any help on this issue will be welcome,
>
> hi,
>   Can you please specify what statement you are passing in to the
> sqlite3_exec please ?
> Atul
>
> --
> View this message in context:
> http://www.nabble.com/sqlite3_exec-fails-on-arm-tp25293839p25340486.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to