/* Execute an SQL statement. Return a Cursor object if the statement is a query, otherwise return the number of tuples affected by the statement.  */
static int conn_execute(lua_State *L)
/* Execute an SQL statement. Return a Cursor object if the statement is a query, otherwise return the number of tuples affected by the statement.  */
static int conn_execute(lua_State *L)
{
		lua_pushnumber(L, atof(PQcmdTuples(res)));
		PQclear (res);
		return 1;
	}
	else if (res && PQresultStatus(res)==PGRES_TUPLES_OK)
		return create_cursor (L, 1, res);
	else {
		PQclear (res);
		return luasql_faildirect(L, PQerrorMessage(conn->pg_conn));
	}
}