Errors with ODBC

2008-02-12 Thread David Lee
I'm using FreeTDS to connect to SQL Server using ODBC and am getting errors for different things: irb(main):001:0 Certificate.columns ODBC::Error: 37000 (170) [FreeTDS][SQL Server]Line 1: Incorrect syntax near '1'. irb(main):003:0 Certificate.first ODBC::Error: 37000 (170) [FreeTDS][SQL

Joining the results of a selection

2008-02-12 Thread David Lee
Hi, I wanted to do this: x = DB[:Certificates] x.join( x.select( :MAX[:modified], :serial ).group(:serial), {:modified = :modified, :serial = :serial} ) But the resulting sql turns into: SELECT * FROM Certificates INNER JOIN #Sequel::ODBC::Dataset: 0xb73ec97c ON

Re: design architecture for models

2008-02-12 Thread Sharon Rosner
1. Sequel provides thread safety, connection pooling.. How can I test and verify that connection pooling is working? svn co http://assistance.rubyforge.org/svn/trunk assistance cd assistance spec spec/connection_pool_spec.rb 2. When and where should I open a connection to the db? You

Re: execute_select without a block?

2008-02-12 Thread Aman Gupta
On Feb 12, 7:42 am, Joseph McDonald [EMAIL PROTECTED] wrote: Hi, I was wondering if execute_select could return the results even if no block is given.  Right now, this works: @DB.execute_select(sql) {  |rows|   rows.each do |row|     puts row: #{row}   end } This doesn't (I think it

Re: Errors with ODBC

2008-02-12 Thread Chris Farmiloe
MSSQL doesn't support LIMIT ... make sure you are using the odbc_mssql adaptor... not just generic ODBC one On 12/02/2008, David Lee [EMAIL PROTECTED] wrote: I'm using FreeTDS to connect to SQL Server using ODBC and am getting errors for different things: irb(main):001:0

Re: batch inserting

2008-02-12 Thread Sharon Rosner
Just for clarification: The Dataset#insert method can take a hash, an array (or multiple arguments), or no argument at all. If no argument is given the insert statement is formatted using DEFAULT VALUES. If a hash is given, the insert statement is formatted using the column names and the

design architecture for models

2008-02-12 Thread winston
I am currently writing an app using ramaze and sequel, and have some queries which I hope the community here can help me with. 1. Sequel provides thread safety, connection pooling.. How can I test and verify that connection pooling is working? 2. When and where should I open a connection to the

execute_select without a block?

2008-02-12 Thread Joseph McDonald
Hi, I was wondering if execute_select could return the results even if no block is given. Right now, this works: @DB.execute_select(sql) { |rows| rows.each do |row| puts row: #{row} end } This doesn't (I think it used to): rows = @DB.execute_select(sql) rows.each do |row| puts row: