Given the following query string,
symbol = "'AAPL'"
query = """SELECT TOP (1000000)
[date]
,[symbol]
,[open]
,[high]
,[low]
,[close]
,[volume]
,[exch]
FROM [AMEXEOD].[dbo].[Stocks_eod]
where
symbol = :symbol
order by
date desc"""
When I try to execute it:
df = pd.read_sql_query(query, conn, params={'symbol': symbol})
I get an error:
('The SQL contains 0 parameter markers, but 1 parameters were supplied', 'HY000')
I thought the :symbol
is the way to mark parameters?