From: Fabien Wernli Date: Sat, 6 Feb 2010 22:03:31 +0000 (+0000) Subject: the way I thought. ribasushi suggested to override deploy(ment_statements) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=852a66f632b509db30a5052093bed49c164fe77e;p=dbsrgits%2FDBIx-Class-Historic.git the way I thought. ribasushi suggested to override deploy(ment_statements) --- diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index a2b2f90..792679a 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -42,6 +42,9 @@ sub _dbh_last_insert_id { sub _dbh_get_autoinc_seq { my ($self, $dbh, $source, $col) = @_; + my $quote_char = $self->schema->storage->{'_sql_maker_opts'}->{'quote_char'}; + my $name_sep = $self->schema->storage->{'_sql_maker_opts'}->{'name_sep'}; + # look up the correct sequence automatically my $sql = q{ SELECT trigger_body FROM ALL_TRIGGERS t @@ -72,14 +75,16 @@ sub _dbh_get_autoinc_seq { AND t.status = 'ENABLED' }; $sth = $dbh->prepare($sql); - $sth->execute( uc($schema), uc($table) ); + my $table_name = $quote_char ? "$quote_char$table$quote_char" : uc($table); + die $table_name; + $sth->execute( uc($schema), $table_name ); } else { $sth = $dbh->prepare($sql); - $sth->execute( uc( $source_name ) ); + $sth->execute( $source_name ); } while (my ($insert_trigger) = $sth->fetchrow_array) { - return uc($1) if $insert_trigger =~ m!(\w+)\.nextval!i; # col name goes here??? + return $1 if $insert_trigger =~ m!("?\w+"?)\.nextval!i; # col name goes here??? } $self->throw_exception("Unable to find a sequence INSERT trigger on table '" . $source->name . "'."); }