freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Cedric ROUVRAIS <cedric.rouvrais AT sgcib.com>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] rowcount not available? [NC]
- Date: Thu, 20 Aug 2009 16:46:00 -0400
Hi James,
I have found the issue and contrarily to what I thought, it isn't dblib. i
don't think so.
The initial script running on Sybase, simplified :o)
exec > aa.lst 2>&1
echo start of the script
isql -U user -P pwd -S server -D database<<EOF
set rowcount 10
insert table_dst
select * from table_src
go
EOF
echo end of the script
The correct script
exec > aa.lst 2>&1
echo start of the script
isql -U user -P pwd -S server -D database<<EOF
set rowcount 10
go
insert table_dst
select * from table_src
go
EOF
echo end of the script
In the corrected script I get row count. Don't know why in the first I
don't
Sorry. just found this.
a++ Cedric
|------------------------------
| "James K. Lowden"
| <jklowden@freetds
| .org>
| Sent by:
| freetds-bounces@l
| ists.ibiblio.org
|
|
| 08/20/2009 01:38
| PM
|
|
| Please respond to
| FreeTDS
| Development Group
| <freetds AT lists.ib
| iblio.org>
|
|
To
FreeTDS Development Group
<freetds AT lists.ibiblio.org>
cc
Subject
Re: [freetds] rowcount not
available? [NC]
Cedric ROUVRAIS wrote:
> When I execute select @@ROWCOUNT I get
> the correct count that is to say. Why would the rowcount not be
> available ?
The server knows the rowcount after a statement completes. For
non-SELECT, that's when control returns to the application after
dbsqlexec(). For SELECT, that's after the last row is fetched by client,
when dbnextrow() returns NO_MORE_ROWS. (That is why @@rowcount is always
right: you can't select @@rowcount until the prior statement completes.)
Whether or not the rowcount is returned to the client depends on a
connection option: SET NOCOUNT {ON|OFF}.
If you think db-lib is wrong, that it reports the rowcount as unavailable
when in fact it *is* available, first confirm: using TDSDUMP, see if a
rowcount packet was sent.
http://www.freetds.org/tds.html#t253
The DONE packet should have the "rowcount valid" bit set, and the rowcount
should be correct. If both those are true for your packet, dbrows()
should succeed.
HTH.
--jkl
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
*************************************************************************
This message and any attachments (the "message") are confidential, intended
solely for the addressee(s), and may contain legally privileged information.
Any unauthorised use or dissemination is prohibited. E-mails are susceptible
to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or
affiliates shall be liable for the message if altered, changed or falsified.
*************************************************************************
-
[freetds] rowcount not available? [NC],
Cedric ROUVRAIS, 08/13/2009
-
Re: [freetds] rowcount not available? [NC],
Mittel, Alexander, 08/14/2009
-
Re: [freetds] rowcount not available? [NC],
Cedric ROUVRAIS, 08/14/2009
-
Re: [freetds] rowcount not available? [NC],
Mittel, Alexander, 08/18/2009
- Re: [freetds] rowcount not available? [NC], Cedric ROUVRAIS, 08/18/2009
-
Re: [freetds] rowcount not available? [NC],
Mittel, Alexander, 08/18/2009
-
Re: [freetds] rowcount not available? [NC],
Cedric ROUVRAIS, 08/14/2009
-
Re: [freetds] rowcount not available? [NC],
James K. Lowden, 08/20/2009
- Re: [freetds] rowcount not available? [NC], Cedric ROUVRAIS, 08/20/2009
-
[freetds] BCP In of data too large fails [NC],
Cedric ROUVRAIS, 08/20/2009
-
Re: [freetds] BCP In of data too large fails [NC],
Thompson, Bill D (London), 08/21/2009
-
Re: [freetds] BCP In of data too large fails [NC],
Cedric ROUVRAIS, 08/21/2009
-
Re: [freetds] BCP In of data too large fails [NC],
James K. Lowden, 08/23/2009
-
Re: [freetds] BCP In of data too large fails [NC],
Cedric ROUVRAIS, 08/23/2009
- Re: [freetds] BCP In of data too large fails [NC], James K. Lowden, 08/24/2009
- Re: [freetds] BCP In of data too large fails [NC], Konrad J Hambrick, 08/24/2009
- Re: [freetds] BCP In of data too large fails [NC], Cedric ROUVRAIS, 08/24/2009
- Re: [freetds] BCP In of data too large fails [NC], Konrad J Hambrick, 08/24/2009
- Re: [freetds] BCP In of data too large fails [NC], Cedric ROUVRAIS, 08/24/2009
-
Re: [freetds] BCP In of data too large fails [NC],
Cedric ROUVRAIS, 08/23/2009
-
Re: [freetds] BCP In of data too large fails [NC],
James K. Lowden, 08/23/2009
-
Re: [freetds] BCP In of data too large fails [NC],
Cedric ROUVRAIS, 08/21/2009
-
Re: [freetds] BCP In of data too large fails [NC],
Thompson, Bill D (London), 08/21/2009
-
Re: [freetds] rowcount not available? [NC],
Mittel, Alexander, 08/14/2009
Archive powered by MHonArc 2.6.24.