Re: DBI ODBC select statement length



Since no one else seems to have answered I'll jump in with a few questions that might be helpful.

Does it make any difference if there is an embedded newline in the statement?

Is there a way to query the server to find out what query it thinks it's gotten? I've never worked with MSSQL so I don't know what sort of tools are available.

Can you get any useful information by turning DBI tracing on?

-Chris

On Aug 29, 2007, at 2:16 PM, Brian Johnson wrote:

Hey folks -

We have written an app that makes a connection to a MSSQL server using ODBC. It works great as long as the length of our select statement is 668 characters or less. As soon as it hits 669 characters, it hangs forever doing the execute. It also fails if we use $dbh->do() instead of $dbh->prepare() and $dbh->execute.

I have googled like crazy trying to find some direction, but have come up empty. Has anybody seen this before? Or is this something obvious and I should be hit with a rolled up news paper for not figuring it out?

Thanks.

-Brian

--
Christopher Sarnowski
csarnows@xxxxxxxxxxxxxx
Penn Bioinformatics Core
1316 Blockley Hall MC 6021
(215) 746-7784


.



Relevant Pages

  • Re: Using part of a field
    ... See the article "Finding and replacing characters using wildcards" at: ... AS400 SQL may have a different way of doing ... called i.dsn, containing the followiing text: ... sort of thing in a query. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Export to Ascii
    ... characters in a calculated field when you export a query. ... Modify your query to append its output to the temporary table; ... "John Nurick" wrote: ... that instead of concatenating with a delimiter it concatenates a fixed ...
    (microsoft.public.access.externaldata)
  • Re: SQL too long?
    ... I haven't done a thorough analysis here, but I suspect that the number of characters needed to express the SQL may not be as important as the number of aggregate functions like Sumand Countthat you invoke along the way. ... Although what you now have may be correct, assuming no simian behavior on the part of Access, splitting up the Query may also make it easier to debug if you later encounter any questions concerning its correctness, or if you need to revise it in some way. ... For example, in my copy of Access 2000, it says that the "Number of characters in an SQL statement" has a maximum value of "approximately 64,000", so you probably have some wiggle room there, even without using abbreviated aliases for some of the names. ... tblARTrn01.invno) INNER JOIN tblARMst01 ON tblDUPSFreight.invno = tblARMst01. ...
    (microsoft.public.access.queries)
  • Re: Problem with sql statement in VB
    ... I think that your admonition to "never use concatenation to build ... to build a second query or as parameters to a second query, ... > Of course you could use, but you never know what are special characters, ... >> searching for SQL Injection Attack. ...
    (microsoft.public.vb.database.ado)
  • Re: Subquery Confusion
    ... Then I got this crazy idea that an Array can only contain a maximum ... number of characters, ... Then I decide that maybe I'm completely wrong with my query, ... it out of Excel VBA and spit it into Microsoft SQL Server Management ...
    (microsoft.public.excel.programming)