Skip to Content.
Sympa Menu

freetds - RE: Help - I am going crazy...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Jay Van Vark <jay AT vanvark.net>
  • To: TDS Development Group <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: Help - I am going crazy...
  • Date: Mon, 05 Aug 2002 08:47:07 -0700


Thanks, that is the direction I have gone and kinda have it working...

There are some SQL issues that I am having to do more reg expression stuff
than I was hoping for -- ie ORDER BY can't be in the intended SQL...

What is the deal with the @@ROWCOUNT -- why can't I use that and do two
queries... I can't believe that people are using this connection without
rowcount...? The driver must just be prefetching all the rows and storing
them in ram , but that pre fetch is slow...


On 8/5/02 7:55 AM, "ZIGLIO Frediano" <Frediano.Ziglio AT vodafoneomnitel.it>
wrote:

>>
>> I can't find a solution to getting the current number of rows
>> from a select
>> query. I can't believe that there isn't one -- no one would
>> be using this...
>>
>> I am using the freeTDS from CVS and the odbc connection - I
>> am using it
>> through PHP. I need to be able to get the number of rows
>> before I fetch all
>> the rows or I need to be able to backup to the first row if I
>> need to loop
>> through all the fetches (boy that would be slow).
>>
>> I have been trying to get a second select after the first one
>> executes with
>> the SELECT @@ROWCOUNT - which if done after the fetches
>> returns just fine.
>> However, if I try to do the execute before the fetch, that
>> fails - there are
>> results pending.
>>
>> For some reason, even doing a select COUNT(*) from (other
>> query) derivedtbl
>> - this seems to take for ever if I do the two queries one
>> right after the
>> other, but run by itself -- it is fine...
>>
>> Wow -- this is a royal pain...
>>
>> Please any suggestions are welcome and appreciated...!
>>
> Sybase and MSSQL do not return rowcount until return all rows.
> So a solution could be
>
> SELECT fields INTO #tmp FROM ...
> SELECT COUNT(*) FROM #tmp
> SELECT * FROM #tmp
> DROP #tmp
>
> (note that #tmp is dropped automatically at the end of connection)
>
> freddy77
>
> =================================
> "STRICTLY PERSONAL AND CONFIDENTIAL
>
> This message may contain confidential and proprietary material for the sole
> use of the intended recipient. Any review or distribution by others is
> strictly prohibited. If you are not the intended recipient please contact
> the sender and delete all copies.
> The contents of this message that do not relate to the official business of
> our company shall be understood as neither given nor endorsed by it."
>
> =================================
>
> ---
> You are currently subscribed to freetds as: [jay AT vanvark.net]
> To unsubscribe, forward this message to
> $subst('Email.Unsub')
>


Jay Van Vark
'Guiding Positive Change in High-Tech Companies'
one box voicemail (866) 248-7670 x 6471
efax (801) 659-7952

-- Great tool for advertising bid optimization, check out:
http://www.Promote4Less.com






Archive powered by MHonArc 2.6.24.

Top of Page