X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FOracle%2FGeneric.pm;h=a90755c72e7f972124f6df22c1fc57f0422b0612;hb=feature_needs_rework%2Foracle_default_insert;hp=2b4ce757bf0c661e254f54e53b679cb70257450f;hpb=f8135512c346d8cb6f3dc569f4bb11576e85f97b;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index 2b4ce75..a90755c 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -115,6 +115,21 @@ sub deployment_statements { $self->next::method($schema, $type, $version, $dir, $sqltargs, @rest); } +sub insert { + my ($self, $source, $to_insert) = @_; + + # Oracle does not understand INSERT INTO ... DEFAULT VALUES syntax + # Furthermore it does not have any way to insert without specifying any columns + # We can't fix this in SQLMaker::Oracle because it doesn't know which column to add to the statement + unless (%$to_insert) + { + my ($col) = $source->columns; + $to_insert = { $col => \'DEFAULT' }; + } + + return $self->next::method($source, $to_insert); +} + sub _dbh_last_insert_id { my ($self, $dbh, $source, @columns) = @_; my @ids = ();