Обсуждение: Creating Tables

Поиск
Список
Период
Сортировка

Creating Tables

От
Scherf Andreas
Дата:
Hello, i have written the following function to create tables in my
program but Postgres returned that the SQL statement would be ignored.
I have a database connection with a user that has all rights.

Now my question how can i create tables and drop them in my C Code ??

Thanks Andreas

________________________

gint create_database_tables ()
{

res=execSQL("drop table vereine");

res=execSQL("create table vereine (
  number int2,
  v_name text);");

res=execSQL("drop table runner");
res=execSQL("create table runner (
 number int2,
 name text,
 vorname text,
 geb_jahr int2,
 sex int2,
 lauf_nr int2,
 verein int2,
 aktiv int2
  );");
res = PQexec (conn, "END");
PQclear(res);
return 0;
}

--

Scherf Andreas
mail : scherfa@fh-trier.de