Reading defined Data from SQL
<p>I have a Problem with reading data with Pandas.read_sql (...):</p>

<p>My code Looks like this:</p>

<pre><code>import psycopg2 as pg
import pandas as pd

con = pg.connect(host='db123', database='data', user='ortm', password='***')

db = pd.read_sql_query('select calculationtime, state from stateresult WHERE ID = A123', con)
</code></pre>

<p>I get the following Error Message:
Execution failed on sql 'select calculationtime, state from stateresult WHERE ID = A123': FEHLER:  Spalte Ã¢â¬Å¾g351Ã¢â¬Å existiert nicht
LINE 1: ...m stateresult WHERE ID = A123</p>

<p>I tried this with another column which is a boolean or integer. I think it has sth. to do with the column being defined as character varying(250).
I tried to get it to work with a CAST but that didnt work neither.
[I'm using Python 2.7]</p>

<p>Why don't you try this once and inform the response you got.
If your connection with database is correct.But I am not aware about python.Once check it and revert to me if it gives error message. </p>

<pre><code>   db = pd.read_sql_query("select calculationtime, state from stateresult WHERE ID = 'A123'", con)
</code></pre>

python sql pandas