emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Patch for ob-sql.el SQL output
Date: Tue, 21 Dec 2010 16:34:38 +0100	[thread overview]
Message-ID: <80hbe7gmwh.fsf@missioncriticalit.com> (raw)
In-Reply-To: AANLkTinC3ep05g6nbGpcPs4uRTps=hv3DOn7X8cpDtYS@mail.gmail.com

Hi Charles,

Charles Sebold wrote:
> I use org-mode and babel under Windows with osql, and the line separating
> the header from the rest of the rows in the output was bothering me.

Excellent initiative!

> I don't know that this is a really good fix, but maybe it's a start for one?
> It looks for the first output line of all dashes and replaces it later with
> the 'hline when the table is lisp-ified.

It does not work correctly for me (with the osql engine). Look at the
situation before/after your patch:

1. Before

   #+srcname: top-10-dossiers-with-many-presta
   #+begin_src sql
   SET NOCOUNT ON

   SELECT TOP 10 prsAbcID, COUNT(*) AS '# Presta'
   FROM presta
   GROUP BY prsAbcID
   ORDER BY COUNT(*) DESC
   #+end_src

   #+results: top-10-dossiers-with-many-presta
   |         prsAbcID |      # Presta |
   | ---------------- | ------------- |
   |   73020050900111 |            22 |
   |   52020030200047 |            21 |
   |   61020060400007 |            21 |
   |   62020031200052 |            20 |
   |   72020051100016 |            20 |
   |   73020050800025 |            20 |
   |   56020031100002 |            19 |
   |   63020060900056 |            19 |
   |   61020030900049 |            18 |
   |   72020030700040 |            18 |
   |                  |               |

   Another annoying thing is the empty line at the end. With the COUNT ON,
   there is one empty line followed by the count.

2. After

   #+results: top-10-dossiers-with-many-presta
   |         prsAbcID |      # Presta |
   | ---------------- | ------------- |
   |   73020050900111 |            22 |
   |   52020030200047 |            21 |
   |   61020060400007 |            21 |
   |   62020031200052 |            20 |
   |   72020051100016 |            20 |
   |   73020050800025 |            20 |
   |   56020031100002 |            19 |
   |   63020060900056 |            19 |
   |   61020030900049 |            18 |
   |   72020030700040 |            18 |
   |------------------+---------------|

   The hline is not applied on the second line, but at the end of the table.
   Perhaps the good condition is to work on the second line?

Best regards,
  Seb

-- 
Sébastien 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

  reply	other threads:[~2010-12-21 15:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-21 15:02 Patch for ob-sql.el SQL output Charles Sebold
2010-12-21 15:34 ` Sébastien Vauban [this message]
2010-12-21 16:57   ` Charles Sebold
2010-12-21 17:08     ` Charles Sebold
2010-12-21 17:34       ` Eric Schulte
2010-12-21 18:58         ` Charles Sebold
2010-12-22 10:23           ` Sébastien Vauban
2010-12-22 10:05         ` Sébastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80hbe7gmwh.fsf@missioncriticalit.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).