Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Working with dates and Oracle
  • Hi all,

    I'm trying to insert data in my Oracle database with the query builder but I'm having an issue with the date field...

    Normally, the syntax is like this: INSERT INTO tablename VALUES (to_date('2014-04-20','YYYY-MM-DD')). The Fuel query builder sees it as a string so the query looks like this: INSERT INTO tablename VALUES ('to_date(''2014-04-20'',''YYYY-MM-DD'')') and of course it fails.

    So my question is: is there a way to handle dates with the query builder?

    Regards.
  • HarroHarro
    Accepted Answer
    Encapsulate it into a DB::expr().

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion