DBIx-IO

 view release on metacpan or  search on metacpan

IO/OracleIO.pm  view on Meta::CPAN

    my ($self,$seq) = @_;
    ref($self) || (warn("\$self not an object"),return undef);
    my $dbh = $self->{dbh};
    $seq ||= $self->{sequence_name};
##at DBI version requirement prepare_cached
    my $crs = $dbh->prepare_cached("SELECT $seq.NEXTVAL FROM DUAL") || return undef;
    $crs->execute() || return undef;
    return (($crs->fetchrow_array)[0]);
}

sub update_hash
{
    my ($self,$update,$key,$date_format,$hint) = @_;
    ref($self) || (warn("\$self not an object"),return undef);
    ref($update) || ($self->_alert("\$update not a hash ref"), return undef);
    %$update || return -1;
    my $dbh = $self->dbh();
    my $table = $self->table_name();
    unless (ref($key))
    {
        $key = { $self->key_name() => $key };

IO/Table.pm  view on Meta::CPAN

Only a delta of column values that differ between exist_rec and new_rec are updated.
__update__<COLUMN_NAME>($new_val) is called for each column in the delta.
Its up to you to make sure the current record was fetched via a
unique key, otherwise unexpected results can occur.

Return the number of rows updated or false if error (0 is represented as '0E0' which is true).
Return -1 if there was no data to update.
Return -2 if persistence is desired and the updated row could not be fetched.

=cut
sub update
{
    my ($self,$update,$persist) = @_;
    $self->add_values($update) || ($self->{io}->_alert("Can't add values from \$update"), return undef) if ref($update);
    my $delta;
    my $rt;
    unless ($delta = $self->_prepare_update())
    {
        return undef;
    }
    unless ($rt = $self->{io}->update_hash($delta,$self->{fetch_key}))

IO/mysqlIO.pm  view on Meta::CPAN

    {
        $pk = $sth->{mysql_insertid};
    }
    elsif (exists($insert->{$pkname}))
    {
        $pk = $insert->{$pkname};
    }
    return (length($pk) ? $pk : -1.2);
}

sub update_hash
{
    my ($self,$update,$key,$date_format,$hint) = @_;
    ref($self) || (warn("\$self not an object"),return undef);
    ref($update) || ($self->_alert("\$update not a hash ref"), return undef);
    %$update || return -1;
    my $dbh = $self->dbh();
    my $table = $self->table_name();
    unless (ref($key))
    {
        $key = { $self->key_name() => $key };

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.206 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )