diff options
| author | fukachan <fukachan> | 2002-07-24 13:01:39 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-07-24 13:01:39 +0000 |
| commit | 4599ab8ba011c5347a86b763e8aaef04edcf7be6 (patch) | |
| tree | a23c4e3aeb9facb31b035d52d8d5835c9be576ff /fml/lib/IO/Adapter | |
| parent | d9c7e86f8b10d892c3bc7485f0fb6e0cd3124714 (diff) | |
| download | fml8-4599ab8ba011c5347a86b763e8aaef04edcf7be6.tar.gz fml8-4599ab8ba011c5347a86b763e8aaef04edcf7be6.tar.bz2 fml8-4599ab8ba011c5347a86b763e8aaef04edcf7be6.zip | |
implemente getline() of DBI
Diffstat (limited to 'fml/lib/IO/Adapter')
| -rw-r--r-- | fml/lib/IO/Adapter/DBI.pm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fml/lib/IO/Adapter/DBI.pm b/fml/lib/IO/Adapter/DBI.pm index cdba65d7..d29a73c3 100644 --- a/fml/lib/IO/Adapter/DBI.pm +++ b/fml/lib/IO/Adapter/DBI.pm @@ -3,7 +3,7 @@ # Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # All rights reserved. # -# $FML: DBI.pm,v 1.16 2002/07/24 09:30:45 fukachan Exp $ +# $FML: DBI.pm,v 1.17 2002/07/24 11:05:50 fukachan Exp $ # package IO::Adapter::DBI; @@ -176,18 +176,18 @@ same as C<getline()> now. =cut -# Descriptions: get from DBI map +# Descriptions: return a table row as a string sequentially # Arguments: OBJ($self) HASH_REF($args) # Side Effects: none # Return Value: STR sub getline { my ($self, $args) = @_; - croak('getline() not implemented'); + $self->_get_data_from_cache($args, 'getline'); } -# Descriptions: return key from DBI map +# Descriptions: return the primary key in the table sequentially # Arguments: OBJ($self) HASH_REF($args) STR($mode) # Side Effects: none # Return Value: STR @@ -198,10 +198,12 @@ sub get_next_key } -# Descriptions: return value(s) from DBI map +# Descriptions: return value(s) to the primary key in the table +# as ARRAY_REF +# XXX definition is o.k.? # Arguments: OBJ($self) HASH_REF($args) STR($mode) # Side Effects: none -# Return Value: STR +# Return Value: ARRAY_REF sub get_next_value { my ($self, $args) = @_; @@ -241,6 +243,9 @@ sub _get_data_from_cache shift @row; return \@row; } + elsif ($mode eq 'getline') { + return join(" ", @row); + } else { warn("DBI: invalid option"); } |
