in reply to Re^3: Catalyst: model & context object usage
in thread Catalyst: model & context object usage
There is a way to bypass the error, assigning a value to id(Primary Key). Primary key is supposed to be self-increase, right ?DBI Exception: DBD::Oracle::st execute failed: ORA-01400: cannot inser +t NULL into ("SDB2"."BOOKS"."ID") (DBD ERROR: OCIStmtExecute) [for St +atement "INSERT INTO books (rating, title) VALUES (?, ?)" with ParamV +alues: :p1='5', :p2='TCPIP_Illustrated_Vol-2']
sub url_create : Local { my ($self, $c, $title, $rating, $author_id) = @_; # Call create() on the book model object. Pass the table # columns/field values we want to set as hash values my $book = $c->model('DB::Books')->create({
title => $title, rating => $rating }); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Catalyst: model & context object usage
by actualize (Monk) on Aug 11, 2008 at 16:12 UTC | |
by marscld (Beadle) on Aug 12, 2008 at 01:30 UTC | |
by actualize (Monk) on Aug 12, 2008 at 02:22 UTC | |
by marscld (Beadle) on Aug 12, 2008 at 05:42 UTC | |
by actualize (Monk) on Aug 12, 2008 at 07:09 UTC | |
|