Awesome! That fixed it. I think I had the :db_type argument right back when I 
had the other problems, but somewhere along the way I dropped the _ without 
noticing. Sequel is working for me now. I'll still work on getting tinytds 
working, but I can use an ODBC connection now which is great! 

Thank you for the help!

Andy

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Jeremy Evans
Sent: Wednesday, March 09, 2011 4:46 PM
To: sequel-talk
Subject: Re: Seg fault when accessing SQL Server

On Mar 9, 10:54 am, Andy Tinkham <[email protected]> wrote:
> When I established the database connection, it's giving me an object of type 
> Sequel::ODBC::Database. I tried the monkey patch after calling Sequel.odbc, 
> but still got an uninitialized constant error for Sequel::MSSQL. I tried 
> replacing Sequel::MSSQL with Sequel::ODBC, but still got the same "Incorrect 
> syntax near '1'" error. I'm not sure where else to put the monkey patch - it 
> only takes two lines of code to get my error (one creates the database and 
> one queries for the count of a table).
>
> I have freetds 0.82 installed, and I installed it using Homebrew (no idea if 
> that matters. I did find a web page indicating that MacPorts wouldn't install 
> freetds correctly, but don't know of its veracity. I didn't see anything 
> warning against using Homebrew though).
>
> I attached the logger, and here's the sql it gave me in the error: 
> SELECT COUNT(*) AS "COUNT" FROM "GLB_PEOPLE" LIMIT 1
>
> The LIMIT 1 is definitely the problem - SQL Server doesn't support the LIMIT 
> clause (at least in our install of it which is 2005 set for compatibility 
> mode matching something even further back, I think). I tried with and without 
> the :dbtype => 'mssql' argument when I call Sequel.odbc, but it didn't make a 
> difference in this case that I could tell.

That's the problem.  The option name is :db_type, not :dbtype.
With :db_type => 'mssql', it should work correctly.  Sorry I missed that in the 
earlier message.

Jeremy

--
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to