<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 11, 2014 at 7:58 PM, Peter Rabbitson <span dir="ltr">&lt;<a href="mailto:rabbit+dbic@rabbit.us" target="_blank">rabbit+dbic@rabbit.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On 09/11/2014 05:48 PM, Lasse Makholm wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi,<br>
<br>
We&#39;re porting a DBIx::Class application from MySQL to Oracle, containing<br>
some insert statements with no column specifications by way of<br>
$rs-&gt;create({}). This doesn&#39;t seem to work on Oracle.<br>
<br>
DBIx::Class::SQLMaker generates &quot;INSERT INTO table DEFAULT VALUES<br>
RETURNING id INTO ?&quot; which, as far as I can figure is not valid syntax<br>
on Oracle. Neither the is the other common variant for such statements;<br>
&quot;INSERT INTO table () VALUES ()&quot;.<br>
</blockquote>
<br></span>
This is clearly a bug that we&#39;ve never tested for previously. Can you please confirm that the following works on your Oracle RDBMS (yes, the first ()pair is gone):<br>
<br>
INSERT INTO $tablename VALUES(DEFAULT);<br></blockquote><div><br></div><div>That only works for a table with only one column. For more, you&#39;d need to repeat DEFAULT for each column. Otherwise you get: &quot;SQL Error: ORA-00947: not enough values&quot;.</div><div><br></div><div>I wonder how/if an explicit DEFAULT interacts with the typical scenario of having a before insert trigger pulling IDs from a sequence to implement auto increment columns...</div><div><br></div><div>I guess, in a sense, that question boils down whether there&#39;s any difference between:</div><div><br></div><div>INSERT INTO t (a, b) VALUES (DEFAULT, 42)</div><div><br></div><div>and:</div><div><br></div><div>INSERT INTO t (b) VALUES (42)</div><div><br></div><div>In any case, I don&#39;t know the answer but I suspect we have some resident Oracle experts who do... I&#39;ll discuss it with them and report back...</div><div><br></div><div>/L</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
<br>
______________________________<u></u>_________________<br>
List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" target="_blank">http://lists.scsys.co.uk/cgi-<u></u>bin/mailman/listinfo/dbix-<u></u>class</a><br>
IRC: <a href="http://irc.perl.org#dbix-class" target="_blank">irc.perl.org#dbix-class</a><br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" target="_blank">http://dev.catalyst.perl.org/<u></u>repos/bast/DBIx-Class/</a><br>
Searchable Archive: <a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" target="_blank">http://www.grokbase.com/group/<u></u>dbix-class@lists.scsys.co.uk</a><br>
</blockquote></div><br></div></div>