If you thought giving up smoking is hard, spare a thought for patients in Glasgow who applied for a pill to break the habit, but ended up being prescribed Viagra.

The patients were expecting anti-smoking pill Zyban, but a computer glitch led sildenafil, another name for Viagra, being chosen.

Pharmacists discovered the error when an influx of patients began asking for anti-impotence drugs, The Daily Telegraph reports.

Greater Glasgow and Clyde NHS Trust has alerted its GPs.

It released a statement saying, “A computer glitch was discovered by two Glasgow GP practices … As a precaution an advisory email and memo was issued to all practices which use GPass and have installed the e-Formulary [computer system] to alert staff.

“At no time was patient care affected by this as all prescriptions are subject to stringent double checking by both prescribing doctors and pharmacy staff.”

It comes after a study carried out amongst gay and bisexual men for the NHS Smoking Helpline, released today, has found that 41 per cent of gay and bisexual men are smokers, rising to 60 per cent for 25 to 34 year olds, well in excess of the national average of 25 per cent.

The NHS estimate that 12,000 gay men die from smoking related diseases every year, much more than die from HIV/AIDs.

All enclosed public places and workplaces in the UK will become smokefree from 1st July 2007 under the country’s smoking ban.