Caused by: org.postgresql.util.PSQLException: ERROR: column "imagesync__c" is of type boolean but expression is of type character varying

Caused by: org.postgresql.util.PSQLException: ERROR: column "imagesync__c" is of type boolean but expression is of type character varying

我正在使用 WSO2 Report Mediator 将记录插入到 postgreSql Table。面临的问题如 column "imagesync__c" 是 boolean 类型,但表达式是 character varying

类型

仅供参考,

我尝试了下面针对该特定专栏提到的一些转换,不幸的是,其中 none 有效。

参考文献:

CAST Function

TypeCasting

Cast VARCHAR to BOOLEAN

我已经通过 CASTING 在 sql 查询而不是输入参数 .

中解决了我的问题
<property name="syncFlag" scope="default" type="BOOLEAN" value="true"/>
<dbreport description="Insert into product2">
            <connection>
                <pool>
                    <dsName>jdbc/QRSagAppSyncDataSource</dsName>
                </pool>
            </connection>
            <statement>
                <sql><![CDATA[INSERT INTO vonbibra_dev.product2(productcode,db_lastmodifiedbyuser,imagesync__c,sourcename__c)VALUES(?, ?,?,?::BOOLEAN,?)]]></sql>
                <parameter type="VARCHAR" value="CarSales"/>
                <parameter type="VARCHAR" value="qrsintegration"/>
                **<parameter type="VARCHAR" expression="get-property('syncFlag')"/>**
                <parameter type="VARCHAR" value="CarSales"/>
            </statement>
  </dbreport>