How to resolve - ERROR: cannot cast type numeric to boolean

There is no direct cast defined between numeric and boolean. You can use integer as middle-ground. 


ALTER TABLE <schema>.<table_name> ALTER <column_name> TYPE bool USING (<column_name>::int::bool);

Ex:
ALTER TABLE SANGA.SANGA_H_TRANSACTION_DETAILS  ALTER is_active TYPE bool USING (is_active::int::bool);

Comments

Popular posts from this blog

[FATAL] [DBT-10503] Template file is not specified

Resolving ORA-10635 and ORA-39171 Errors During BLOB Tablespace Maintenance

How to resolve RMAN-06035: wrong version of recover.bsq, expecting 11.2.0.4, found 11.2.0.2