Surgery: If neither drugs nor the vacuum pump works, your doctor may suggest surgery. With surgery, the doctor can place a device in your penis that will cause enough hardness for intercourse. In a few cases, infections may develop after the operation, and the doctor may have to remove the device. Another operation that may help you is rebuilding the blood vessels in the penis to increase blood flow into the penis or decrease blood flow out of the penis. These procedures can help you to get and maintain an erection.
The venous constriction device is a device designed to compress the veins that drain blood flow out of the penis to keep blood in the penis. These devices may help individuals who have a "venous leak." In these individuals, although blood flow is coming into the penis, it is draining out at the same time and this persistent drainage prevents a fully rigid erection. These devices may be used with other forms of medical therapy, such as medications, injection therapy, or the vacuum device.
Conditions associated with reduced nerve and endothelium function (eg, aging, hypertension, smoking, hypercholesterolemia, and diabetes) alter the balance between contraction and relaxation factors (see Pathophysiology). These conditions cause circulatory and structural changes in penile tissues, resulting in arterial insufficiency and defective smooth muscle relaxation. In some patients, sexual dysfunction may be the presenting symptom of these disorders.
Phosphodiesterase type V inhibitors (PDE-5 inhibitors) are the most commonly used therapy for erectile dysfunction. These medications work by preventing the breakdown of chemicals that stimulate increased blood flow into the penis. Several different PDE-5 inhibitors are available, which differ slightly in how to use them and their side effects. They appear to be equally effective in the treatment of erectile dysfunction in general, but some individuals may respond to one of these medications more effectively than another.
A common and important cause of ED is vasculogenic. Many men with ED have comorbid conditions such as hyperlipidemia, hypercholesterolemia, tobacco abuse, diabetes mellitus, or coronary artery disease (CAD).  The Princeton III Consensus recommends screening men who present with ED for cardiovascular risk factors; ED may be the earliest presentation of atherosclerosis and vascular disease. 
Dr Kenny du Toit is a urologist practicing in Rondebosch, Cape Town. He is also consultant at Tygerberg hospital, where he is a senior lecturer at Stellenbosch University. He is a member of the South African Urological Association, Colleges of Medicine South Africa and Société Internationale d’Urologie. Board registered with both the HPCSA (Health professions council of South Africa) and GMC (General medical council UK). He has a keen interest in oncology, kidney stones and erectile dysfunction.http://www.dutoiturology.co.za
Treatment depends on the underlying cause. In general, exercise, particularly of the aerobic type, is effective for preventing ED during midlife. Exercise as a treatment is under investigation.:6, 18–19 For tobacco smokers, cessation often results in a significant improvement. Oral pharmacotherapy and vacuum erection devices are first-line treatments,:20, 24 followed by injections of drugs into the penis, as well as penile implants.:25–26 Vascular reconstructive surgeries are beneficial in certain groups.
Additionally, the physiologic processes involving erections begin at the genetic level. Certain genes become activated at critical times to produce proteins vital to sustaining this pathway. Some researchers have focused on identifying particular genes that place men at risk for ED. At present, these studies are limited to animal models, and little success has been reported to date.  Nevertheless, this research has given rise to many new treatment targets and a better understanding of the entire process.
And surgery comes with its own serious risks, such as developing incontinence or impotence, while radiation can result in urinary problems. — Peter Loftus, WSJ, "Surgery Adds Three Years to Lives of Prostate-Cancer Patients, Study Finds," 12 Dec. 2018 Male-impotence pill Viagra began facing generic competition late last year, while the Lyrica pain treatment is expected to confront generics at the end of this year. — Jonathan D. Rockoff, WSJ, "Pfizer Narrows Guidance on Tougher Pricing, Generic Competition," 30 Oct. 2018 Arkham Horror Third Edition is a classic struggle of agency versus impotence, set in the uncanny world of H.P. Lovecraft’s Cthulhu mythos. — Charlie Theel, Ars Technica, "Arkham Horror Third Edition: The classic Lovecraft adventure returns," 24 Nov. 2018 There’s obviously a lot of anger and frustration here toward the US government at the moment—along with side effects like bottled rage and sometimes a creeping sense of ineptitude or impotence about our ability to do anything about it. — Corey Seymour, Vogue, "Pussy Riot's Nadya Tolokonnikova On Her New Guide To Activism, Raising The Next President Of Russia, And Her "Holy War" On Fairy Tales," 12 Oct. 2018 In exchange for political impotence, they would be mostly left alone and allowed to get rich. — Paul Mozur, New York Times, "Inside China’s Dystopian Dreams: A.I., Shame and Lots of Cameras," 8 July 2018 Their suspicion is compounded by rumors that the polio vaccine causes impotence, death and, ironically, paralysis. — Meher Ahmad, New York Times, "Pakistan Has Just One New Polio Case, but Isn’t Declaring Victory Yet," 20 May 2018 Fighting back, even as an exercise in impotence, did a lot for McCain. — Alex Horton, Washington Post, "John McCain rebelled at the Naval Academy — and as a POW — long before he was a Senate maverick," 3 May 2018 Feelings of desperation and impotence are being felt throughout Central America, where the lawlessness, endemic poverty and levels of gang violence akin to war zones that have driven so many families from their homes show little signs of abating. — Washington Post, "Violence keeps Central Americans coming to US despite Trump," 21 June 2018
Factors that mediate contraction in the penis include noradrenaline, endothelin-1, neuropeptide Y, prostanoids, angiotensin II, and others not yet identified. Factors that mediate relaxation include acetylcholine, nitric oxide (NO), vasoactive intestinal polypeptide, pituitary adenylyl cyclase–activating peptide, calcitonin gene–related peptide, adrenomedullin, adenosine triphosphate, and adenosine prostanoids.
As is true in so many medical conditions, lifestyle modifications, considered first-line therapy, can have a salutary effect in ED management, and men should be encouraged to make the necessary changes to the benefit of their sexual function and to their overall health as well. Despite the benefits of behaviour modification, men presenting with ED want the physician to help with measures that can have an immediate impact.
Soler et al. compared sildenafil to vardenafil and tadalafil (69). Sildenafil was effective in 85% of SCI patients, 74% of the patients on vardenafil and 72% of the patients on tadalafil. Sildenafil was associated with more rigid and longer lasting erections. Additionally, 50 mg of sildenafil was effective in 55% of patients compared to more than 70% of the patients on vardenafil and tadalafil requiring 20 mg for a similar response. Men who used tadalafil were able to achieve erections 24 hours after administration, improving overall satisfaction related to the possible spontaneity of sexual encounters. Del Popolo also evaluated the time/duration effectiveness of PDE5i sildenafil 50 mg versus tadalafil 10 mg (64). Tadalafil 10 mg significantly increased the percentage of successful intercourse attempts at 12–24 hours compared with sildenafil. One can suspect that vardenafil, which has a longer half-life than sildenafil, could offer a similar benefit but a study investigating this occurrence has yet to be performed.
Several studies accessed the prevalence of ED. The Massachusetts Male Aging Study reported a prevalence of 52%.2 The study demonstrated that ED is increasingly prevalent with age: approximately 40% of men are affected at age 40 and nearly 70% of men are affected at age 70. The prevalence of complete ED increased from 5% at age 40 to 15% at age 70.2 Age was the variable most strongly associated with ED.
These are not currently approved by the FDA for ED management, but they may be offered through research studies (clinical trials). Patients who are interested should discuss the risks and benefits (informed consent) of each, as well as costs before starting any clinical trials. Most therapies not approved by the FDA are not covered by government or private insurance benefits.