From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: [babel] Verbatim output from SQL command Date: Tue, 18 Oct 2011 15:20:29 +0200 Message-ID: <80mxcymo6a.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org #+BABEL: :engine msosql :cmdline -S -U -P -d -n -w 700 * Show code of stored procedure Despite telling Babel that I'd like to see the output as it is, it displays it in a 4-column table. See http://i.imgur.com/neDO3.png for the original layout in SQL Query Analyser (1 column, 34 lines). Babel seems to interpret every *leading space* as *one empty column*. Normal, feature, bug? Is there some workaround to this? I thought stating "scalar" would really completely override any interpretation... ** Code This is an example of code run against a Microsoft SQL server. #+begin_src sql :eval yes :results output scalar EXEC sp_helptext 'dt_setpropertybyid' #+end_src #+results: | Text | | | | |-----------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+--------------------------------------------| | /* | | | | | | | | | | ** | If the property already exists, reset the value; otherwise add property | | | | | | | | | ** | | id -- the id in sysobjects of the object | | | | | | | | ** | | property -- the name of the property | | | | | | | | ** | | value -- the text value of the property | | | | | | | | ** | | lvalue -- the binary value of the property (image) | | | | | | | | */ | | | | | | | | | | create procedure dbo.dt_setpropertybyid | | | | | | | | | | | @id int, | | | | | | | | | | @property varchar(64), | | | | | | | | | | @value varchar(255), | | | | | | | | | | @lvalue image | | | | | | | | | as | | | | | | | | | | | set nocount on | | | | | | | | | | declare @uvalue nvarchar(255) | | | | | | | | | | set @uvalue = convert(nvarchar(255), @value) | | | | | | | | | | if exists (select * from dbo.dtproperties | | | | | | | | | | | | where objectid=@id and property=@property) | | | | | | | | begin | | | | | | | | | | | -- | | | | | | | | | | -- bump the version count for this row as we update it | | | | | | | | | | -- | | | | | | | | | | update dbo.dtproperties set value=@value, uvalue=@uvalue, lvalue=@lvalue, version=version+1 | | | | | | | | | | | where objectid=@id and property=@property | | | | | | | | end | | | | | | | | | | else | | | ... Best regards, Seb -- Sebastien Vauban