in reply to Error while using Catalyst to insert record to Oracle

It looks like your BOOKS table has an ID column declared NOT NULL. How was the table created?

Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."

  • Comment on Re: Error while using Catalyst to insert record to Oracle

Replies are listed 'Best First'.
Re^2: Error while using Catalyst to insert record to Oracle
by marscld (Beadle) on Aug 15, 2008 at 01:53 UTC
    The problem seems that primary key ID of BOOKS is not being calculated correctly. And it is supposed to be a incremental process to fetch max ID and increase by 1. However, not finding a clue on tutorial. Though Catalyst tutorial uses SQLite as database, I just try to use Oracle instead.

      Oracle uses sequences and triggers, not just a null or zero like some other DB engines. See link for a short discussion. Details can be found in your local Oracle docs but this is at least mentioned in the module description.

      I started with MySQL (which allows what you tried) and have had to deal with many issues with other DB's. Some people may recommend a higher-level DB interface but I've never used them personally.

Re^2: Error while using Catalyst to insert record to Oracle
by marscld (Beadle) on Aug 15, 2008 at 01:40 UTC
    It is created by running a command, which is a little bit different from tutorial.
    script/myapp_create.pl model DB DBIC::Schema MyApp::Schema create=stat +ic dbi:Oracle:OTEST sdb2 sdb