Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Prepared statement problem



I had a problem with PreparedStatement which uses ? after FROM clause.
Server reported org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1"

This is simplified example.

PreparedStatement pstmt;
try {
 pstmt = conn.prepareStatement("SELECT * FROM ?");
 pstmt.setString(1, "ps_nalog");
 pstmt.executeQuery();
} catch (SQLException ex) {
 ex.printStackTrace();
}

Can anybody tell me where is posibble to put ? in a SELECT statement !

best regards,
Djordje Nikolic

www.abanka.co.yu






Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group