On Fri, 23 Jan 2009 08:44:19 +0100
Peter Rabbitson <[email protected]> wrote:


I've been looking at the _07 last dev release and have a question... getting 
some odd results, wondering if there is some way to get feedback.

I altered two tests for mssql to change the artistid to "artist #", accessor 
=>artistid. (This is because I've inherited a table with a column that looks 
like that.)

Turned on quot_char => '"'. Also with [ ]... 

Statement(s) could not be prepared. (SQL-42000) [for Statement "SELECT * FROM
(
    SELECT TOP 3 * FROM
    (
        SELECT TOP 3  [me.artist #], [me.name], [me.rank], [me.charfield] FROM 
[artist] [me] ORDER BY "artist #"  DESC
    ) AS foo
    ORDER BY "artist #"  ASC
) AS bar
ORDER BY "artist #"  DESC

Same problem. Quotes are not supposed to encapsulate the alias, no?

So, I tested with an unmolested version, adding one line to the test to turn on 
the quoting:

t/746mssql.t

# fresh $schema so we start unconnected
$schema = DBICTest::Schema->connect($dsn, $user, $pass, {AutoCommit => 1,
quote_char => '"'
});

Statement(s) could not be prepared. (SQL-42000) [for Statement "SELECT * FROM
(
    SELECT TOP 3 * FROM
    (
        SELECT TOP 3  "me.artistid", "me.name", "me.rank", "me.charfield" FROM 
"artist" "me" ORDER BY artistid ASC
    ) AS foo
    ORDER BY artistid DESC
) AS bar
ORDER BY artistid ASC
"] a

Anyone else see this happening?

Cheers,

-- 
 |\  /|        |   |          ~ ~  
 | \/ |        |---|          `|` ?
 |    |ichael  |   |iggins    \^ /
 michael.higgins[at]evolone[dot]org

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to