Hi!
I need a confirmation: TO_CHAR(boolean-column) works in SQL but not in PL/SQL?
I am missing something here?
BOOLEAN in PL/SQL has different semantics as BOOLEAN in pure SQL?
CREATE TABLE test1 ( b BOOLEAN );
INSERT INTO test1 VALUES ( NULL );
INSERT INTO test1 VALUES ( TRUE );
INSERT INTO test1 VALUES ( FALSE );
SELECT to_char(b) FROM test1;
DROP TABLE test1;
DECLARE
x1 BOOLEAN := TRUE;
BEGIN
dbms_output.put_line(' x1 = ' || to_char(x1) );
END;
/
Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
Table created.
1 row created.
1 row created.
1 row created.
TO_CHAR(B)
---------------
TRUE
FALSE
Table dropped.
dbms_output.put_line(' x1 = ' || to_char(x1) );
*
ERROR at line 4:
ORA-06550: line 4, column 38:
PLS-00306: wrong number or types of arguments in call to 'TO_CHAR'
ORA-06550: line 4, column 5:
PL/SQL: Statement ignored