[Dbix-class] $rs->create() with no column values bombs on Oracle

Lasse Makholm lasse at unity3d.com
Thu Sep 11 15:48:03 GMT 2014


Hi,

We're porting a DBIx::Class application from MySQL to Oracle, containing
some insert statements with no column specifications by way of
$rs->create({}). This doesn't seem to work on Oracle.

DBIx::Class::SQLMaker generates "INSERT INTO table DEFAULT VALUES RETURNING
id INTO ?" which, as far as I can figure is not valid syntax on Oracle.
Neither the is the other common variant for such statements; "INSERT INTO
table () VALUES ()".

A workaround might be to pick an arbitrary column (having a default value)
and doing $rs->create({ column => \'DEFAULT' }), yielding "INSERT INTO
table (some_column) VALUES (DEFAULT) RETURNING id INTO ?" but that seems
hackish and hard to turn into a generic solution. I'm also not familiar
enough with Oracle to know if there are any side-effects from this.

Is this simply a known limitation on Oracle and something I'll have to
handle in my application or am I missing something...?

In any case, it seems like the least I should get is an error from
DBIx::Class instead of an invalid SQL statement.

I'm seeing this with DBIx::Class v0.08270-22-g83d2991 (current master)
against an Oracle 11g XE server.

Any input is appreciated.

Thanks
/Lasse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20140911/c8377d43/attachment.htm>


More information about the DBIx-Class mailing list