execute.c 908 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*****************************************************************************
  2. *
  3. * MODULE: DBF driver
  4. *
  5. * AUTHOR(S): Radim Blazek
  6. *
  7. * PURPOSE: Simple driver for reading and writing dbf files
  8. *
  9. * COPYRIGHT: (C) 2000 by the GRASS Development Team
  10. *
  11. * This program is free software under the GNU General Public
  12. * License (>=v2). Read the file COPYING that comes with GRASS
  13. * for details.
  14. *
  15. *****************************************************************************/
  16. #include <grass/dbmi.h>
  17. #include <grass/glocale.h>
  18. #include "globals.h"
  19. #include "proto.h"
  20. int db__driver_execute_immediate(dbString * sql)
  21. {
  22. char *s;
  23. int ret;
  24. s = db_get_string(sql);
  25. ret = execute(s, NULL);
  26. if (ret == DB_FAILED) {
  27. db_d_append_error(_("Unable to execute statement."));
  28. db_d_report_error();
  29. return DB_FAILED;
  30. }
  31. return DB_OK;
  32. }