Toad World® Forums

How to Declare variables in Toad DA for postgreSQL

I am currently doing the following and getting an error
at or near “varchar”. I’m using the eProfessional evaluation version 3.0.1.1734

declare

date1 VARCHAR(

19) := ‘2010-01-02 00:00:00’;

date2 VARCHAR(

19) := ‘2010-01-08 00:00:00’;

begin

select *

from dcm.claims c

where c.insurance_policy_exp between TO_DATE (date1,

‘yyyy/mm/dd hh24:mi:ss’)

AND TO_DATE (date2,

‘yyyy/mm/dd hh24:mi:ss’));
end;