DBD-XMLSimple

 view release on metacpan or  search on metacpan

lib/DBD/XMLSimple.pm  view on Meta::CPAN

use warnings;

@DBD::XMLSimple::Table::ISA = qw(DBI::DBD::SqlEngine::Table);

sub new
{
	my($class, $data, $attr, $flags) = @_;

	$attr->{table} = $data;
	$attr->{readonly} = 1;
	$attr->{cursor} = 0;

	my $rc = $class->SUPER::new($data, $attr, $flags);

	$rc->{col_names} = $attr->{col_names};
	$rc->{col_nums} = $attr->{col_nums};
	return $rc;
}

sub fetch_row($$)
{
	my($self, $data) = @_;

	if($self->{'cursor'} >= $data->{'rows'}) {
		return;
	}
	$self->{'cursor'}++;

	my @fields = map { $self->{'data'}->{$self->{'cursor'}}->{$_ } } @{$self->{'col_names'}};
	$self->{'row'} = \@fields;

	return $self->{'row'};
}

sub seek($$$$)
{
	my($self, $data, $pos, $whence) = @_;

	print "seek $pos $whence, not yet implemented\n";



( run in 0.241 second using v1.01-cache-2.11-cpan-4d50c553e7e )