On 1/13/23 09:08, Adam Scott wrote:
> Do you mean like this?
>
> postgres=# \set v_embed %:v_ssn%
> postgres=# \echo :v_embed
> %345%
> postgres=# SELECT * FROM employee WHERE ssn LIKE :'v_embed';
> ssn | name
> -----------+----------
> 123456789 | John Doe
> (1 row)
>
>
Actually that replicates what Ron got to work. What Ron is looking for
is to skip the intermediate step and do:
\set v_ssn 345
SELECT * FROM employee WHERE ssn LIKE :'%v_ssn%';
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com