ERROR: Could not SQLPrepare

Hi,
I get this error when I try to do select as the book “Asterisk the future of Telephony” asks me to do. Please let me know what is wrong.

Regards,
Amir

The Postgresql is installed correctly. Here is the trace when I do the commands from the prompt. Asterisk also gives a similar error. The trace from asteriks is listed below.

root@dell-desktop:/etc/postgresql/8.3/main# odbcinst -q -d
[PostgreSQL]
root@dell-desktop:/etc/postgresql/8.3/main# su - asterisk
root@dell-desktop:/etc/postgresql/8.3/main# echo “select 1” | isql -v asterisk-connector
±--------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
±--------------------------------------+
SQL> [-----][unixODBC]START: hStmt = 0x8073990 nAttribute = 10010
[-----][unixODBC]END: Attribute not supported.
[-----][unixODBC]START: hStmt = 0x8073990 nAttribute = 10011
[-----][unixODBC]END: Attribute not supported.
[-----][unixODBC]START: hStmt = 0x8073990 nAttribute = 10012
[-----][unixODBC]END: Attribute not supported.
[-----][unixODBC]START: hStmt = 0x8073990 nAttribute = 10013
[-----][unixODBC]END: Attribute not supported.
[-----][unixODBC]hStmt = 0x8073990
[-----][unixODBC]syntax error processing ‘select’ on line 1
[ISQL]ERROR: Could not SQLPrepare

I also get the same error as asterisk runs. Here is the trace from asterisk.

*CLI> moh reload
> Error in PREPARE -1
[May 15 19:10:30] WARNING[4689]: res_odbc.c:127 ast_odbc_prepare_and_execute: SQL Prepare failed. Attempting a reconnect…
[May 15 19:10:30] WARNING[4689]: res_odbc.c:480 odbc_obj_disconnect: res_odbc: disconnected 0 from asterisk [asterisk-connector]
[May 15 19:10:30] NOTICE[4689]: res_odbc.c:519 odbc_obj_connect: Connecting asterisk
[May 15 19:10:30] NOTICE[4689]: res_odbc.c:533 odbc_obj_connect: res_odbc: Connected to asterisk [asterisk-connector]
> Error in PREPARE -1
[May 15 19:10:30] WARNING[4689]: res_odbc.c:127 ast_odbc_prepare_and_execute: SQL Prepare failed. Attempting a reconnect…
[May 15 19:10:30] WARNING[4689]: res_odbc.c:480 odbc_obj_disconnect: res_odbc: disconnected 0 from asterisk [asterisk-connector]
[May 15 19:10:30] NOTICE[4689]: res_odbc.c:519 odbc_obj_connect: Connecting asterisk
[May 15 19:10:30] NOTICE[4689]: res_odbc.c:533 odbc_obj_connect: res_odbc: Connected to asterisk [asterisk-connector]
[May 15 19:10:30] WARNING[4689]: res_config_odbc.c:483 config_odbc: SQL select error!
[]