From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: Patch for ob-sql.el SQL output Date: Wed, 22 Dec 2010 11:23:54 +0100 Message-ID: <80fwtqayx1.fsf@missioncriticalit.com> References: <80hbe7gmwh.fsf@missioncriticalit.com> <877hf381yp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Charles, Charles Sebold wrote: > What do you think would be a good solution for the blank between the outp= ut > of a table and the row count if someone didn't run SET NOCOUNT ON? > > I mean, should that be another hline, or no blank line, or what? > > If somebody's trying to programatically use this table, it will mess up > their data, but I would think they wouldn't have NOCOUNT off in that case. I always disable the COUNT (let's say, enable the NOCOUNT) as this messes up all the tables, but I don't have a good solution, would we want to see the total -- which is, though, an instructive and important data. Depending on the context of the SELECT, it could sometimes be equivalent to= an Org table formula (vsum), but how to automatically tell?? > It seems to me like the right thing to do is another hline, but I'm not > convinced. And it is even more of a hack, because I don't know how to test > for the "rows affected" line without an ugly search for some regexp like " > rows? affected)", and in other language environments I would guess it > doesn't even say that. > > In the intermediate output file the row count line is preceded by a blank > line, but if there is only one column being output how can you tell the > difference between that and a blank record? > > Anyway, if somebody wants the row count line at the moment I don't know h= ow > to work around the extra blank without a ton of logic for single-column or > multi-column responses, and this is probably just making this code more a= nd > more osql-specific, which will not be helpful for people on free database > systems. But if anybody has any ideas or suggestions, I may have a little > time to try to implement them. I would say that you could identify that blank line by looking at line "-2"= , I mean counted from the bottom of the table. I have no idea how other engines report such data (I don't have Postgre or MySQL at hand), but I'd be interested in hearing from them. Other idea: don't put the COUNT information in the table, but just under it, as normal Org text. Maybe that's the most portable and viable solution? Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode