emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-sbe to automate some source block executions


From: Ihor Radchenko
Subject: Re: org-sbe to automate some source block executions
Date: Wed, 25 Nov 2020 19:39:03 +0800

> I am trying to implement it, do you see here anything below that I am
> doing wrong? Error is that it cannot find source block stages

You should assign a name to your source block. Also, I am clueless why
you need a variable ":var results=stages". You should probably do
something like the following:

** Stages

#+name: stages   
#+BEGIN_SRC sql :engine postgresql :exports results
SELECT -- salesflowstages_priority AS "Priority", 
       salesflowstages_publicstage AS "Development Stages" --,
--       salesflowstages_description AS "Description" 
FROM salesflowstages
WHERE salesflowstages_salesflows = 1 
ORDER BY salesflowstages_priority ASC
#+END_SRC

# Local Variables:
# eval: (org-sbe "stages")
# End:

Best,
Ihor


Jean Louis <bugs@gnu.support> writes:

> * Eric S Fraga <e.fraga@ucl.ac.uk> [2020-11-24 12:46]:
>> On Tuesday, 24 Nov 2020 at 12:00, Jean Louis wrote:
>> > Can I automated the execution of Babel code upon opening of the Org
>> > file?
>> 
>> You can, by using file local variables.  For instance, for some files, I
>> do this:
>> 
>> #+begin_src org
>>   ,* local variables                         :noexport:
>>   # Local Variables:
>>   # eval: (org-sbe "startup")
>>   # End:
>> #+end_src
>> 
>> which will evaluate the named src block "startup" when file is
>> opened.
>
> I am trying to implement it, do you see here anything below that I am
> doing wrong? Error is that it cannot find source block stages
>
> ** Stages
>    
> #+BEGIN_SRC sql :var results=stages :engine postgresql :exports results
> SELECT -- salesflowstages_priority AS "Priority", 
>        salesflowstages_publicstage AS "Development Stages" --,
> --       salesflowstages_description AS "Description" 
> FROM salesflowstages
> WHERE salesflowstages_salesflows = 1 
> ORDER BY salesflowstages_priority ASC
> #+END_SRC
>
> # Local Variables:
> # eval: (org-sbe "stages")
> # End:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]