On 13/10/11 17:55, Gabriel Filipiak wrote:
Hi all, Hi Gabe, A complex query will be executed by PostgreSQL far more efficiently than a series of simpler queries – even if both are initiated via JDBC. An example where dynamic SQL would useful would be in SQL generated to support a search function with multiple fields, some of which are optional. From memory, when I did this in Java, the Java application constructed the query and passed it via JDBC to the database. In another situation,
I
constructed stored procedures in Sybase TransactSQL with
dynamically
executed SQL to support a report generation program where some of
the
search fields where optional. PostgreSQL is easier to work with,
but
it was an existing database. Also using Java was not practicable.
and
(see the section '9.4. String Functions and Operators' of the PostgreSQL 9.1.1 manual)
. |