Well a little more playing around and I got this to work:
sandbox=> \set MPcode to_char('LIPI3');
sandbox=> \echo :MPcode
to_char('LIPI3');
sandbox=> select MasterProductID from sandbox.DimProductMaster where MasterProductCode = :MPcode;
MasterProductID
-----------------
4867
(1 row)
Hi, I have defined a vsql variable: \set MPcode 'LIPI3'; now I would like to use it like so: select MasterProductID from sandbox.DimProductMaster where MasterProductCode = :MPcode; where MasterProductCode is a varchar but I get the error ERROR 2624: Column "LIPI3" does not exist How do I specify the...