« blib/lib/blx/xsdsql/ios/ostream.pm
↑ Summary
blib/lib/blx/xsdsql/schema_repository/sql/generic/binding.pm »
| 1 | package blx::xsdsql::schema_repository::sql::oracle::cursor; | ||
| 2 | |||
| 3 | use strict; # use strict is for PBP | ||
| 4 | use Filter::Include; | ||
| 5 | include blx::xsdsql::include; | ||
| 6 | #line 7 | ||
| 7 | |||
| 8 | use blx::xsdsql::ut::ut qw(nvl); | ||
| 9 | use base qw(blx::xsdsql::schema_repository::sql::generic::cursor); | ||
| 10 | |||
| 11 | sub _manip_value { | ||
| 12 | my ($self,$col,$value,%params)=@_; | ||
| 13 | my $t=$col->get_attrs_value(qw(TYPE_DUMPER)); | ||
| 14 | affirm { defined $t } "attribute TYPE_DUMPER not set for column ".nvl($col->get_full_name); | ||
| 15 | if (defined $value) { | ||
| 16 | if ($t->{BASE} eq 'boolean') { | ||
| 17 | if ($value eq 'Y') { | ||
| 18 | $value='1' | ||
| 19 | } | ||
| 20 | elsif ($value eq 'N') { | ||
| 21 | $value='0'; | ||
| 22 | } | ||
| 23 | else { | ||
| 24 | croak "'$value': invalid value for boolean type"; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | elsif ($t->{BASE} eq 'decimal') { | ||
| 28 | $value=~s/0+$// if $value=~/\./; | ||
| 29 | $value=~s/\.$//; | ||
| 30 | } | ||
| 31 | } | ||
| 32 | return $value; | ||
| 33 | } | ||
| 34 | |||
| 35 | |||
| 36 | 1; | ||
| 37 | |||
| 38 | __END__ |