Perry Mason wasn’t a detective.
Neither was James Bond, mush less on TV.
See also:
"Casino Royale" is a live 1954 television adaptation of the novel of the same name by Ian Fleming. An episode of the American dramatic anthology series Climax!, the show is the first screen adaptation of a James Bond novel and stars Barry Nelson, Peter Lorre, and Linda Christian. Though this marks the first onscreen appearance of the secret agent, Nelson's Bond is played as an American spy with "Combined Intelligence Agency" and is referred to as "Jimmy" by several characters.
But you are correct, not a detective.
Actually, he wasn't even real.
Honorable mention - Petrocelli.
Neither is Bones. She is an anthropologist.
Perry Mason wasn’t a detective, but Paul Drake was. He’d always find the info Perry needed to get his client off the hook. So Paul Drake needs a mention.