# Oracle :time field issue

**URL:** <https://www.ruby-forum.com/t/oracle-time-field-issue/116037>\
**Category:** Rails\
**Created:** [October 1, 2007, 8:25pm UTC](https://www.ruby-forum.com/t/oracle-time-field-issue/116037 "2007-10-01T20:25:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [October 1, 2007, 8:25pm UTC](https://www.ruby-forum.com/t/oracle-time-field-issue/116037/1 "2007-10-01T20:25:47Z")

</div>

What field type should I use to store time in oracle? I tried :time but  
that actually creates a date field that doesn’t work with time\_select,  
it gives me the error “1 error(s) on assignment of multiparameter  
attributes”.

Thanks,

–  
Greg D.  
Cyberfusion Consulting  
[http://cyberfusionconsulting.com/](http://cyberfusionconsulting.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [October 1, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/oracle-time-field-issue/116037/2 "2007-10-01T22:46:14Z")

</div>

Greg D. wrote:

> What field type should I use to store time in oracle? I tried :time but  
> that actually creates a date field that doesn’t work with time\_select,  
> it gives me the error “1 error(s) on assignment of multiparameter  
> attributes”.
> 
> Thanks,
> 
> –  
> Greg D.  
> Cyberfusion Consulting  
> [http://cyberfusionconsulting.com/](http://cyberfusionconsulting.com/)

i hope someone answers…i’ve got my oracle birthdate column defined as  
Date if that helps plus here something i’ve found…\<%=  
Time.now.to\_s(:db) %\> interesting that it adds a another parameter to  
String class .to\_s (to string method) using the :db (unknown?)…dave

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [October 2, 2007, 3:40am UTC](https://www.ruby-forum.com/t/oracle-time-field-issue/116037/3 "2007-10-02T03:40:26Z")

</div>

On Mon, 1 Oct 2007, Dave R. wrote:

> Greg D. wrote:
> 
> > What field type should I use to store time in oracle? I tried :time but  
> > that actually creates a date field that doesn’t work with time\_select,  
> > it gives me the error “1 error(s) on assignment of multiparameter  
> > attributes”.
> 
> i hope someone answers…i’ve got my oracle birthdate column defined as  
> Date if that helps plus here something i’ve found…\<%=  
> Time.now.to\_s(:db) %\> interesting that it adds a another parameter to  
> String class .to\_s (to string method) using the :db (unknown?)…dave

I ended up using an oracle ‘date’ field even though I only need to store  
a time, seems there’s really no other choice. You can’t use a string  
type  
if you want to use any rails helpers. And then even using the oracle  
date  
field the time\_select helper won’t work with it. I’m having to use the  
select\_datetime helper for now.

The weird thing about the oracle date field is the oracle web interface  
only shows me the date. I have to query using to\_char( meds, ‘hh:mi’ )  
to be able to see the time portion, the part I need to actually see.

–  
Greg D.  
Cyberfusion Consulting  
[http://cyberfusionconsulting.com/](http://cyberfusionconsulting.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [October 2, 2007, 2:45pm UTC](https://www.ruby-forum.com/t/oracle-time-field-issue/116037/4 "2007-10-02T14:45:57Z")

</div>

> I ended up using an oracle ‘date’ field even though I only need to store  
> a time, seems there’s really no other choice. You can’t use a string  
> type  
> if you want to use any rails helpers. And then even using the oracle  
> date  
> field the time\_select helper won’t work with it. I’m having to use the  
> select\_datetime helper for now.
> 
> The weird thing about the oracle date field is the oracle web interface  
> only shows me the date. I have to query using to\_char( meds, ‘hh:mi’ )  
> to be able to see the time portion, the part I need to actually see.
> 
> –  
> Greg D.  
> Cyberfusion Consulting  
> [http://cyberfusionconsulting.com/](http://cyberfusionconsulting.com/)  
> …could you help me… i’m using this:

 Birthdate: \<%= date\_select :spec, :birthdate, :start\_year =\> Spec::START\_YEAR, :end\_year =\> Time.now.year, :include\_blank =\> true, :order =\> [:year, :month, :day] %\> 
and i still am getting an active record error ActiveRecord::MultiparameterAssignmentErrors in SpecController#edit

1 error(s) on assignment of multiparameter attributes …dave

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [October 2, 2007, 5:22pm UTC](https://www.ruby-forum.com/t/oracle-time-field-issue/116037/5 "2007-10-02T17:22:08Z")

</div>

On Tue, 2 Oct 2007, Dave R. wrote:

> ActiveRecord::MultiparameterAssignmentErrors in SpecController#edit
> 
> 1 error(s) on assignment of multiparameter attributes …dave

You might try wrapping the options in {} so date\_select doesn’t get  
confused. Or maybe try using the form\_for syntax.

–  
Greg D.  
Cyberfusion Consulting  
[http://cyberfusionconsulting.com/](http://cyberfusionconsulting.com/)

---

<div class="post-metadata">

**Author:** ![destiney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f07891/32.png) [@destiney](https://www.ruby-forum.com/u/destiney)\
**Post date:** [October 2, 2007, 8:20pm UTC](https://www.ruby-forum.com/t/oracle-time-field-issue/116037/6 "2007-10-02T20:20:21Z")

</div>

Greg D. wrote:

> On Tue, 2 Oct 2007, Dave R. wrote:
> 
> > ActiveRecord::MultiparameterAssignmentErrors in SpecController#edit
> > 
> > 1 error(s) on assignment of multiparameter attributes …dave
> 
> You might try wrapping the options in {} so date\_select doesn’t get  
> confused. Or maybe try using the form\_for syntax.
> 
> –  
> Greg D.  
> Cyberfusion Consulting  
> [http://cyberfusionconsulting.com/](http://cyberfusionconsulting.com/)

how did you eliminate your time of day in your date\_select form  
helper?..dave
