verbatim and overlays

verbatim is only possible with the macro \defverbatim. However, instead of verbatim you should use the package listings. Can be done in the same way. If you need it colored then use \defverbatim[colored]{...}

\documentclass{beamer}      
\begin{document}

\defverbatim{\foo}{%
\begin{verbatim}
Select T3.Subject
From  T as T1, T as T2, T as T3
Where T1.Predict=“BornOnDate” and 
T1.Object=“1809-02-12” and
T2.Predict=“DiedOnDate” and
T2.Object=“1865-04-15” and 
T3. Predict=“hasName” and
T1.Subject = T2.Subject and 
T2. Subject= T3.subject
\end{verbatim}
}

\begin{frame}{Some title}
\only<2->{\foo}
\end{frame}
\end{document}

Verbatim material isn't allowed in macro argument, because the full argument is read before verbatim is processed. By then all text is already converted internally, i.e. all \abcd are already macros, all %text is already stripped etc.

Because frame is actually a pseudo-environment which reads its content like a macro you need to use its fragile option to take special care for verbatim and similar content. However, you are still not allowed to use it inside a macro's argument. I would store it in a box register and use that inside \only. For some reason this doesn't work with the verbatim environment but well with lstlisting from the listing package. You can and should also box the material outside of a frame, then you don't need the fragile option.

\documentclass{beamer}
\newsavebox{\mysavebox}
\usepackage{listings}


\begin{document}

\begin{lrbox}{\mysavebox}
\begin{lstlisting}
Select T3.Subject
From  T as T1, T as T2, T as T3
Where T1.Predict="BornOnDate" and 
T1.Object="1809-02-12" and
T2.Predict="DiedOnDate" and
T2.Object="1865-04-15" and 
T3. Predict="hasName" and
T1.Subject = T2.Subject and 
T2. Subject= T3.subject
\end{lstlisting}
\end{lrbox}

\begin{frame}{Some title}
\only<2->{\usebox{\mysavebox}}
\end{frame}

\end{document}