Using Substitution Variables In PostgreSQL

From: Osahon Oduware <osahon(dot)gis(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Using Substitution Variables In PostgreSQL
Date: 2017-10-16 14:08:39
Message-ID: CAGpiUSgvUTCt2Mtrg+HpUbfCZBaB6WVMnopPYh0E7iC7bst1GQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

I wanted to find out how to use a substitution variable in an SQL statement
that would cause the user to be prompted for a value. Something similar to
the ampersand (&&) in ORACLE.

For example, given the SQL statement below:
SELECT <col1>,<col2>,<col3>
FROM <table>
WHERE <col5> = 35

I want the user to be prompted for the value in the WHERE (filter) clause,
e.g.
SELECT <col1>,<col2>,<col3>
FROM <table>
WHERE <col5> = ?

I would be glad if someone could point me in the right direction.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2017-10-16 14:19:04 Re: Force SSL connection
Previous Message rakeshkumar464 2017-10-16 14:05:01 Force SSL connection