I get the following error:
-----------
PGError: ERROR: syntax error at or near "default"
RAD 1: SELECT * FROM ivr_menus ORDER BY default LIMIT 20 OFFSET 0
^
: SELECT * FROM ivr_menus ORDER BY default LIMIT 20 OFFSET 0
--------------
Why?
Table definition:
class CreateIvrMenus < ActiveRecord::Migration
def self.up
create_table :ivr_menus do |t|
t.integer :parent_id
t.string :name, :limit => 20
t.integer :schedule_id
t.string :open_phrase
t.string :close_phrase
t.integer :close_action
t.string :close_action_value
t.integer :timeout_action
t.string :timeout_action_value
t.string :timeout_phrase
end
end
def self.down
drop_table :ivr_menus
end
end
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
On Monday 11 June 2007, Jonas wrote:> I get the following error: > > ----------- > > PGError: ERROR: syntax error at or near "default" > RAD 1: SELECT * FROM ivr_menus ORDER BY default LIMIT 20 OFFSET 0 > ^ > > : SELECT * FROM ivr_menus ORDER BY default LIMIT 20 OFFSET 0 > > -------------- > > Why?Because default is an SQL keyword. You need to provide a column name (or rather an expression) and optionally either ASC or DESC. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Schuerig wrote:> On Monday 11 June 2007, Jonas wrote: >> -------------- >> >> Why? > > Because default is an SQL keyword. You need to provide a column name (or > rather an expression) and optionally either ASC or DESC. > > Michael > > -- > Michael Schuerig > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org > http://www.schuerig.de/michael/But I do not have a column called "default". I do not understand where the word "default" comes from in the query. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Monday 11 June 2007, Jonas wrote:> Michael Schuerig wrote: > > On Monday 11 June 2007, Jonas wrote: > >> -------------- > >> > >> Why? > > > > Because default is an SQL keyword. You need to provide a column > > name (or rather an expression) and optionally either ASC or DESC.> But I do not have a column called "default". I do not understand > where the word "default" comes from in the query.To give us a chance of solving your problem you''ll have to show us the code that results in this query being executed> PGError: ERROR: syntax error at or near "default" > RAD 1: SELECT * FROM ivr_menus ORDER BY default LIMIT 20 OFFSET 0 > ^ > > : SELECT * FROM ivr_menus ORDER BY default LIMIT 20 OFFSET 0Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---