d_drop_col.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*!
  2. * \file db/dbmi_driver/d_drop_col.c
  3. *
  4. * \brief DBMI Library (driver) - drop column
  5. *
  6. * (C) 1999-2008 by the GRASS Development Team
  7. *
  8. * This program is free software under the GNU General Public
  9. * License (>=v2). Read the file COPYING that comes with GRASS
  10. * for details.
  11. *
  12. * \author Joel Jones (CERL/UIUC), Radim Blazek
  13. */
  14. #include <stdlib.h>
  15. #include <grass/dbmi.h>
  16. #include "macros.h"
  17. #include "dbstubs.h"
  18. /*!
  19. \brief Drop column
  20. \return DB_OK on success
  21. \return DB_FAILED on failure
  22. */
  23. int db_d_drop_column(void)
  24. {
  25. dbString tableName;
  26. dbString columnName;
  27. int stat;
  28. db_init_string(&tableName);
  29. db_init_string(&columnName);
  30. /* get the arg(s) */
  31. DB_RECV_STRING(&tableName);
  32. DB_RECV_STRING(&columnName);
  33. /* call the procedure */
  34. stat = db_driver_drop_column(&tableName, &columnName);
  35. db_free_string(&tableName);
  36. db_free_string(&columnName);
  37. /* send the return code */
  38. if (stat != DB_OK) {
  39. DB_SEND_FAILURE();
  40. return DB_OK;
  41. }
  42. DB_SEND_SUCCESS();
  43. /* no results */
  44. return DB_OK;
  45. }