I am trying to come up with a beamer frame where some listing appears at the left column on overlay 1 and some other stuff appears in its place in overlay 2, while some stuff appears in the right column for both overlays. I came up with this minimal example, which doesn't work, giving me an error
Missing } inserted.
<inserted text>
}
If I comment out the \only<1>{}, it works, but not with it and I can't figure it out. Any help would be much appreciated.
\documentclass{beamer}
\usetheme{Madrid}
\usecolortheme{whale}
\beamertemplatenavigationsymbolsempty
\usepackage{listings}
\begin{document}
\begin{frame}[t,fragile]
\frametitle{Test}
\begin{columns}
\begin{column}{0.4\textwidth}
\only<1>{
\vspace{1cm}
\begin{lstlisting}[language=SQL,mathescape, showstringspaces=false]
SELECT ENAME
FROM PROJ, ASG, EMP
\end{lstlisting}
}
\only<2>{
There is another line of text that I want to appear in left column in the \alert{second} overlay.
}
\end{column}
\begin{column}{0.4\textwidth}
\begin{center}
Some stuff that I want to appear on the right column on both overlays.
\end{center}
\end{column}
\end{columns}
\end{frame}
\end{document}