Re: [Orgmode] [Babel] Tangling ignores LOB file?

2010-12-15 Thread Eric Schulte
Hi Seb,

I just pushed up a fix which should allow noweb references to be
resolved using the library of babel.

Thanks -- Eric

Sébastien Vauban  writes:

> #+TITLE: Tangling process ignores LOB?
> #+DATE:  2010-12-07
> #+LANGUAGE:  en_US
>
> #+BABEL: :cmdline -S server -U user -P password -d database -n -w 700 
> :results output :exports both
>
> * Abstract
>
> References to named code blocks located in a LOB file seem to be ignored by
> the tangling process.
>
> * Example
>
> ** Common code
>
> These 2 SQL code blocks are, and will be, reused all over the place:
>
> #+srcname: set-count-off
> #+begin_src sql :eval never
> -- no longer display the count message
> SET NOCOUNT ON
> #+end_src
>
> #+srcname: defvar-now
> #+begin_src sql :eval never
> DECLARE @now smalldatetime
> SET @now = CONVERT(smalldatetime,
>CAST(YEAR(GETDATE()) AS char(4)) + '-' +
>CAST(MONTH(GETDATE()) AS char(2)) + '-' +
>CAST(DAY(GETDATE()) AS char(2)) + ' ' +
>CAST(DATEPART(hh, GETDATE()) AS char(2)) + ':' +
>CAST(DATEPART(mi, GETDATE()) AS char(2)) + ':' +
>'00',
>120) -- ODBC canonical
> #+end_src
>
> ** Specific code
>
> For example, I use them here:
>
> #+begin_src sql :engine msosql :noweb yes
> <>
> <>
> SELECT TOP 5 @now AS now
> FROM table
> #+end_src
>
> #+results:
> | now |
> | --- |
> | 2010-12-07 15:14:00 |
> | 2010-12-07 15:14:00 |
> | 2010-12-07 15:14:00 |
> | 2010-12-07 15:14:00 |
> | 2010-12-07 15:14:00 |
> | |
>
> And it works (see the /results/ table). But...
>
> * Problem
>
> If I put the *common code blocks* into some LOB file (i.e., I move them out of
> this file) and ingest it, then the specific code does not properly run
> anymore.
>
> In other words, it seems that the tangle process does not take into account
> the code blocks located in the LOB.
>
> Best regards,
>   Seb

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [Babel] Tangling ignores LOB file?

2010-12-07 Thread Sébastien Vauban
#+TITLE: Tangling process ignores LOB?
#+DATE:  2010-12-07
#+LANGUAGE:  en_US

#+BABEL: :cmdline -S server -U user -P password -d database -n -w 700 :results 
output :exports both

* Abstract

References to named code blocks located in a LOB file seem to be ignored by
the tangling process.

* Example

** Common code

These 2 SQL code blocks are, and will be, reused all over the place:

#+srcname: set-count-off
#+begin_src sql :eval never
-- no longer display the count message
SET NOCOUNT ON
#+end_src

#+srcname: defvar-now
#+begin_src sql :eval never
DECLARE @now smalldatetime
SET @now = CONVERT(smalldatetime,
   CAST(YEAR(GETDATE()) AS char(4)) + '-' +
   CAST(MONTH(GETDATE()) AS char(2)) + '-' +
   CAST(DAY(GETDATE()) AS char(2)) + ' ' +
   CAST(DATEPART(hh, GETDATE()) AS char(2)) + ':' +
   CAST(DATEPART(mi, GETDATE()) AS char(2)) + ':' +
   '00',
   120) -- ODBC canonical
#+end_src

** Specific code

For example, I use them here:

#+begin_src sql :engine msosql :noweb yes
<>
<>
SELECT TOP 5 @now AS now
FROM table
#+end_src

#+results:
| now |
| --- |
| 2010-12-07 15:14:00 |
| 2010-12-07 15:14:00 |
| 2010-12-07 15:14:00 |
| 2010-12-07 15:14:00 |
| 2010-12-07 15:14:00 |
| |

And it works (see the /results/ table). But...

* Problem

If I put the *common code blocks* into some LOB file (i.e., I move them out of
this file) and ingest it, then the specific code does not properly run
anymore.

In other words, it seems that the tangle process does not take into account
the code blocks located in the LOB.

Best regards,
  Seb

-- 
Sébastien Vauban


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode