DBD-Oracle icon indicating copy to clipboard operation
DBD-Oracle copied to clipboard

Support 23ai BOOLEAN type

Open jurahudak opened this issue 1 year ago • 0 comments

The boolean type in 23ai is not recognized. Should be mapped to SQL_BOOLEAN, eg DBI::Shell added support for boolean formatting and uses SQL_BOOLEAN to identify such column.

select dump(to_boolean(1)) /
+-------------------+
|DUMP(TO_BOOLEAN(1))|
+-------------------+
|Typ=252 Len=1: 1   |
+-------------------+

Value in statement handler {TYPE} hashref should be SQL_BOOLEAN/16.

perl -MData::Dumper -MDBI -e ' $dbh = DBI->connect("dbi:Oracle:tcps://...oraclecloud.com", "...", "..."); $sth = $dbh->prepare("select to_boolean(0)"); print Dumper( $sth->{TYPE} );'
$VAR1 = [
          8
        ];

Now with this proper type value the DBI::Shell would start working as expected:

> /option bool_format=yep,nah
/option bool_format=yep,nah  (was TRUE,FALSE)  
> select to_boolean(0) union select to_boolean(1) /
+-------------+
|TO_BOOLEAN(0)|
+-------------+
|nah          |
|yep          |
+-------------+

Thanks.

jurahudak avatar Nov 01 '24 19:11 jurahudak