I am having this problem with pagination query in my controller class.
I am using SQL server and following code to create pagination fails,
complains about column name ‘program_name’ (which is valid
column/attribute of program)
The error message is:
DBI::DatabaseError: S0022 (207) [Microsoft][ODBC SQL Server
Driver][SQL Server]Invalid column name ‘program_name’.: SELECT * FROM
(SELECT TOP 3 * FROM (…rest of query deleted…
I have to include status Active Record class because :order clause is
dynamic and may be by status name which in status model (program model
belongs_to status)
The :include works fine on Program.find(…) in console as below:
I have encountered the same issue and was wondering what steps you took
to solve it if any.
Thanks,
Steve
Navjeet C. wrote:
I am having this problem with pagination query in my controller class.
I am using SQL server and following code to create pagination fails,
complains about column name ‘program_name’ (which is valid
column/attribute of program)
The error message is:
DBI::DatabaseError: S0022 (207) [Microsoft][ODBC SQL Server
Driver][SQL Server]Invalid column name ‘program_name’.: SELECT * FROM
(SELECT TOP 3 * FROM (…rest of query deleted…
I have to include status Active Record class because :order clause is
dynamic and may be by status name which in status model (program model
belongs_to status)
The :include works fine on Program.find(…) in console as below: