On Oct 6, 10:52 pm, Jeremy Evans <[EMAIL PROTECTED]> wrote:
> On Oct 6, 1:23 pm, File <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I've done this code:
>
> > $db = Sequel.odbc('EmpyreanAge', :user => 'admin', :password =>
> > 'password')
> > #$db = Sequel.odbc('EmpyreanAge', :user => 'admin', :password =>
> > 'password', :db_type => 'mssql')
> > @sql = $db[:invTypes].sql
>
> > At the end of it I get @sql = 'SELECT * FROM "INVTYPES"', which won't
> > work in SQL Server 2005 (express edition) cause my table is invTypes
> > and not INVTYPES. Is this a mssql server setting thing or is there a
> > tweak I can use in Sequel so that :invTables == [invTables].
>
> I don't think that there is a setting for it yet.  You can work around
> the issue by redefining quoted_identifier for the database not to call
> upcase.

Yup, this change on my script just after the require made sequel's sql
work for mssql.

module Sequel
  class Dataset
    def quoted_identifier(name)
      "\[#{name.to_s}\]"
    end
  end
end

> A patch that adds a Sequel::Database.upcase_identifiers=
> setting would be appreciated if you can find the time.
>
> Thanks,
> Jeremy

I would gladly help but I'm lost on your code, I had to grep -r
'upcase' *.rb just to find the function to override. ;)

Anyways I'm lost on how you define which database you are speaking to,
because when I do the a connect to sqlite3 it all works fine (probably
the adapter is overriding this function) but on ado or odbc, how would
you find which db are you connecting to? I mean there's even a odbc
driver for sqlite3! So... I'm lost. There should be a odbc WhatAreYou
function that responded "Hello I'm a MS SQL SERVER 2005 db, so don't
quote my identifiers, mmmk!?"

Tnx for the quick reply,
File
--~--~---------~--~----~------------~-------~--~----~
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